Skip to content

Commit af3a6d1

Browse files
Paulo Alcantarasmfrench
authored andcommitted
cifs: update cifs_ses::ip_addr after failover
cifs_ses::ip_addr wasn't being updated in cifs_session_setup() when reconnecting SMB sessions thus returning wrong value in /proc/fs/cifs/DebugData. Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 8da33fd commit af3a6d1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fs/cifs/connect.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4025,10 +4025,16 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
40254025
struct nls_table *nls_info)
40264026
{
40274027
int rc = -ENOSYS;
4028+
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr;
4029+
struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
40284030
bool is_binding = false;
40294031

4030-
40314032
spin_lock(&cifs_tcp_ses_lock);
4033+
if (server->dstaddr.ss_family == AF_INET6)
4034+
scnprintf(ses->ip_addr, sizeof(ses->ip_addr), "%pI6", &addr6->sin6_addr);
4035+
else
4036+
scnprintf(ses->ip_addr, sizeof(ses->ip_addr), "%pI4", &addr->sin_addr);
4037+
40324038
if (ses->ses_status != SES_GOOD &&
40334039
ses->ses_status != SES_NEW &&
40344040
ses->ses_status != SES_NEED_RECON) {

0 commit comments

Comments
 (0)