diff options
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, | |||
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); |