diff options
author | Steve French <sfrench@us.ibm.com> | 2007-04-25 11:59:10 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-04-25 11:59:10 +0000 |
commit | 5858ae44e289ac6c809af3fe81b9a6ed41914d41 (patch) | |
tree | b62cf39ee27152cdfb891d2f723f0f00b3cbc346 /fs/cifs/connect.c | |
parent | cbac3cba66ab51492da53e7bf4f38da872408065 (diff) | |
download | lwn-5858ae44e289ac6c809af3fe81b9a6ed41914d41.tar.gz lwn-5858ae44e289ac6c809af3fe81b9a6ed41914d41.zip |
[CIFS] Add IPv6 support
IPv6 support was started a few years ago in the cifs client, but lacked a
kernel helper function for parsing the ascii form of the ipv6 address. Now
that that is added (and now IPv6 is the default that some OS use now) it
was fairly easy to finish the cifs ipv6 support. This requires that
CIFS_EXPERIMENTAL be enabled and (at least until the mount.cifs module is
modified to use a new ipv6 friendly call instead of gethostbyname) and the
ipv6 address be passed on the mount as "ip=" mount option.
Thanks
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 9e41f8ea5fbb..c139fbd24be9 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1790,11 +1790,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, existingCifsSes = cifs_find_tcp_session(&sin_server.sin_addr, NULL /* no ipv6 addr */, volume_info.username, &srvTcp); - else if(address_type == AF_INET6) + else if(address_type == AF_INET6) { + cFYI(1,("looking for ipv6 address")); existingCifsSes = cifs_find_tcp_session(NULL /* no ipv4 addr */, &sin_server6.sin6_addr, volume_info.username, &srvTcp); - else { + } else { kfree(volume_info.UNC); kfree(volume_info.password); kfree(volume_info.prepath); @@ -1810,12 +1811,18 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, sin_server.sin_port = htons(volume_info.port); else sin_server.sin_port = 0; - rc = ipv4_connect(&sin_server,&csocket, + if (address_type == AF_INET6) { + cFYI(1,("attempting ipv6 connect")); + /* BB should we allow ipv6 on port 139? */ + /* other OS never observed in Wild doing 139 with v6 */ + rc = ipv6_connect(&sin_server6,&csocket); + } else + rc = ipv4_connect(&sin_server,&csocket, volume_info.source_rfc1001_name, volume_info.target_rfc1001_name); if (rc < 0) { cERROR(1, - ("Error connecting to IPv4 socket. Aborting operation")); + ("Error connecting to IPv4 socket. Aborting operation")); if(csocket != NULL) sock_release(csocket); kfree(volume_info.UNC); |