Commit b176041c authored by Steve French's avatar Steve French Committed by Steve French

[CIFS] cifs ipv6 support part 2

Signed-off-by: Steve French (sfrench@us.ibm.com)
parent 63f2d1ce
...@@ -814,19 +814,23 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol ...@@ -814,19 +814,23 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
} }
static struct cifsSesInfo * static struct cifsSesInfo *
cifs_find_tcp_session(__u32 new_target_ip_addr, cifs_find_tcp_session(struct in_addr * target_ip_addr,
struct in6_addr *target_ip6_addr,
char *userName, struct TCP_Server_Info **psrvTcp) char *userName, struct TCP_Server_Info **psrvTcp)
{ {
struct list_head *tmp; struct list_head *tmp;
struct cifsSesInfo *ses; struct cifsSesInfo *ses;
*psrvTcp = NULL; *psrvTcp = NULL;
read_lock(&GlobalSMBSeslock); read_lock(&GlobalSMBSeslock);
list_for_each(tmp, &GlobalSMBSessionList) { list_for_each(tmp, &GlobalSMBSessionList) {
ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList);
if (ses->server) { if (ses->server) {
if (ses->server->addr.sockAddr.sin_addr.s_addr == if((target_ip_addr &&
new_target_ip_addr) { (ses->server->addr.sockAddr.sin_addr.s_addr
== target_ip_addr->s_addr)) || (target_ip6_addr
&& memcmp(&ses->server->addr.sockAddr6.sin6_addr,
target_ip6_addr,sizeof(*target_ip6_addr)))){
/* BB lock server and tcp session and increment use count here?? */ /* BB lock server and tcp session and increment use count here?? */
*psrvTcp = ses->server; /* found a match on the TCP session */ *psrvTcp = ses->server; /* found a match on the TCP session */
/* BB check if reconnection needed */ /* BB check if reconnection needed */
...@@ -1235,8 +1239,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -1235,8 +1239,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
} }
existingCifsSes = existingCifsSes =
cifs_find_tcp_session(sin_server.sin_addr.s_addr, cifs_find_tcp_session(&sin_server.sin_addr,
volume_info.username, &srvTcp); NULL /* no ipv6 addr */,
volume_info.username, &srvTcp);
if (srvTcp) { if (srvTcp) {
cFYI(1, ("Existing tcp session with server found ")); cFYI(1, ("Existing tcp session with server found "));
} else { /* create socket */ } else { /* create socket */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment