Commit 6debdbc0 authored by Simo Leone's avatar Simo Leone Committed by Steve French

[CIFS] Copy struct *after* setting the port, instead of before.

Acked-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSimo Leone <simo@archlinux.org>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 6459340c
...@@ -1496,14 +1496,14 @@ cifs_get_tcp_session(struct smb_vol *volume_info) ...@@ -1496,14 +1496,14 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
cFYI(1, ("attempting ipv6 connect")); cFYI(1, ("attempting ipv6 connect"));
/* BB should we allow ipv6 on port 139? */ /* BB should we allow ipv6 on port 139? */
/* other OS never observed in Wild doing 139 with v6 */ /* other OS never observed in Wild doing 139 with v6 */
sin_server6->sin6_port = htons(volume_info->port);
memcpy(&tcp_ses->addr.sockAddr6, sin_server6, memcpy(&tcp_ses->addr.sockAddr6, sin_server6,
sizeof(struct sockaddr_in6)); sizeof(struct sockaddr_in6));
sin_server6->sin6_port = htons(volume_info->port);
rc = ipv6_connect(tcp_ses); rc = ipv6_connect(tcp_ses);
} else { } else {
sin_server->sin_port = htons(volume_info->port);
memcpy(&tcp_ses->addr.sockAddr, sin_server, memcpy(&tcp_ses->addr.sockAddr, sin_server,
sizeof(struct sockaddr_in)); sizeof(struct sockaddr_in));
sin_server->sin_port = htons(volume_info->port);
rc = ipv4_connect(tcp_ses); rc = ipv4_connect(tcp_ses);
} }
if (rc < 0) { if (rc < 0) {
......
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