diff options
author | Samuel Cabrero <scabrero@suse.de> | 2020-10-16 11:54:55 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-10-21 17:57:02 -0500 |
commit | def6e1dc17816826fac94f6a5ce125fdee3231ae (patch) | |
tree | e211f81a03ee797d7fa30e3c5478f18baabeb300 /fs | |
parent | 62593011247c8a8cfeb0c86aff84688b196727c2 (diff) | |
download | linux-def6e1dc17816826fac94f6a5ce125fdee3231ae.tar.bz2 |
cifs: Print the address and port we are connecting to in generic_ip_connect()
Can be helpful in debugging mount and reconnect issues
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/connect.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 1a3b7793095e..d096cfda56eb 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3902,13 +3902,21 @@ generic_ip_connect(struct TCP_Server_Info *server) saddr = (struct sockaddr *) &server->dstaddr; if (server->dstaddr.ss_family == AF_INET6) { - sport = ((struct sockaddr_in6 *) saddr)->sin6_port; + struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&server->dstaddr; + + sport = ipv6->sin6_port; slen = sizeof(struct sockaddr_in6); sfamily = AF_INET6; + cifs_dbg(FYI, "%s: connecting to [%pI6]:%d\n", __func__, &ipv6->sin6_addr, + ntohs(sport)); } else { - sport = ((struct sockaddr_in *) saddr)->sin_port; + struct sockaddr_in *ipv4 = (struct sockaddr_in *)&server->dstaddr; + + sport = ipv4->sin_port; slen = sizeof(struct sockaddr_in); sfamily = AF_INET; + cifs_dbg(FYI, "%s: connecting to %pI4:%d\n", __func__, &ipv4->sin_addr, + ntohs(sport)); } if (socket == NULL) { |