diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-06-11 16:27:30 +0200 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-06-13 10:17:30 +0200 |
commit | 1e68b2b2756fc3488ecbade5ad5f13302b3aaafc (patch) | |
tree | 3ee4b36a1a00d449126050ce3bb1758ba88d7c2f /fs/cifs/connect.c | |
parent | cifs: have cifs_show_options show forceuid/forcegid options (diff) | |
download | linux-1e68b2b2756fc3488ecbade5ad5f13302b3aaafc.tar.xz linux-1e68b2b2756fc3488ecbade5ad5f13302b3aaafc.zip |
cifs: add new routine for converting AF_INET and AF_INET6 addrs
...to consolidate some logic used in more than one place.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 97f4311b9a8e..c368ad658236 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1433,28 +1433,15 @@ cifs_get_tcp_session(struct smb_vol *volume_info) memset(&addr, 0, sizeof(struct sockaddr_storage)); - if (volume_info->UNCip && volume_info->UNC) { - rc = cifs_inet_pton(AF_INET, volume_info->UNCip, - &sin_server->sin_addr.s_addr); - - if (rc <= 0) { - /* not ipv4 address, try ipv6 */ - rc = cifs_inet_pton(AF_INET6, volume_info->UNCip, - &sin_server6->sin6_addr.in6_u); - if (rc > 0) - addr.ss_family = AF_INET6; - } else { - addr.ss_family = AF_INET; - } + cFYI(1, ("UNC: %s ip: %s", volume_info->UNC, volume_info->UNCip)); - if (rc <= 0) { + if (volume_info->UNCip && volume_info->UNC) { + rc = cifs_convert_address(volume_info->UNCip, &addr); + if (!rc) { /* we failed translating address */ rc = -EINVAL; goto out_err; } - - cFYI(1, ("UNC: %s ip: %s", volume_info->UNC, - volume_info->UNCip)); } else if (volume_info->UNCip) { /* BB using ip addr as tcp_ses name to connect to the DFS root below */ |