diff options
author | Steve French <sfrench@us.ibm.com> | 2007-04-25 07:59:10 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-04-25 07:59:10 -0400 |
commit | 5858ae44e289ac6c809af3fe81b9a6ed41914d41 (patch) | |
tree | b62cf39ee27152cdfb891d2f723f0f00b3cbc346 /fs/cifs/connect.c | |
parent | cbac3cba66ab51492da53e7bf4f38da872408065 (diff) |
[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 9e41f8ea5fb..c139fbd24be 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, | |||
1790 | existingCifsSes = cifs_find_tcp_session(&sin_server.sin_addr, | 1790 | existingCifsSes = cifs_find_tcp_session(&sin_server.sin_addr, |
1791 | NULL /* no ipv6 addr */, | 1791 | NULL /* no ipv6 addr */, |
1792 | volume_info.username, &srvTcp); | 1792 | volume_info.username, &srvTcp); |
1793 | else if(address_type == AF_INET6) | 1793 | else if(address_type == AF_INET6) { |
1794 | cFYI(1,("looking for ipv6 address")); | ||
1794 | existingCifsSes = cifs_find_tcp_session(NULL /* no ipv4 addr */, | 1795 | existingCifsSes = cifs_find_tcp_session(NULL /* no ipv4 addr */, |
1795 | &sin_server6.sin6_addr, | 1796 | &sin_server6.sin6_addr, |
1796 | volume_info.username, &srvTcp); | 1797 | volume_info.username, &srvTcp); |
1797 | else { | 1798 | } else { |
1798 | kfree(volume_info.UNC); | 1799 | kfree(volume_info.UNC); |
1799 | kfree(volume_info.password); | 1800 | kfree(volume_info.password); |
1800 | kfree(volume_info.prepath); | 1801 | kfree(volume_info.prepath); |
@@ -1810,12 +1811,18 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1810 | sin_server.sin_port = htons(volume_info.port); | 1811 | sin_server.sin_port = htons(volume_info.port); |
1811 | else | 1812 | else |
1812 | sin_server.sin_port = 0; | 1813 | sin_server.sin_port = 0; |
1813 | rc = ipv4_connect(&sin_server,&csocket, | 1814 | if (address_type == AF_INET6) { |
1815 | cFYI(1,("attempting ipv6 connect")); | ||
1816 | /* BB should we allow ipv6 on port 139? */ | ||
1817 | /* other OS never observed in Wild doing 139 with v6 */ | ||
1818 | rc = ipv6_connect(&sin_server6,&csocket); | ||
1819 | } else | ||
1820 | rc = ipv4_connect(&sin_server,&csocket, | ||
1814 | volume_info.source_rfc1001_name, | 1821 | volume_info.source_rfc1001_name, |
1815 | volume_info.target_rfc1001_name); | 1822 | volume_info.target_rfc1001_name); |
1816 | if (rc < 0) { | 1823 | if (rc < 0) { |
1817 | cERROR(1, | 1824 | cERROR(1, |
1818 | ("Error connecting to IPv4 socket. Aborting operation")); | 1825 | ("Error connecting to IPv4 socket. Aborting operation")); |
1819 | if(csocket != NULL) | 1826 | if(csocket != NULL) |
1820 | sock_release(csocket); | 1827 | sock_release(csocket); |
1821 | kfree(volume_info.UNC); | 1828 | kfree(volume_info.UNC); |