From: Thomas Werschlein Date: Thu, 30 Aug 2018 16:29:20 +0000 (+0200) Subject: cifs: connect to servername instead of IP for IPC$ share X-Git-Tag: v4.19~232^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=395a2076b4064f97d3fce03af15210ff2a7bb7f9;p=platform%2Fkernel%2Flinux-rpi.git cifs: connect to servername instead of IP for IPC$ share This patch is required allows access to a Microsoft fileserver failover cluster behind a 1:1 NAT firewall. The change also provides stronger context for authentication and share connection (see MS-SMB2 3.3.5.7 and MS-SRVS 3.1.6.8) as noted by Tom Talpey, and addresses comments about the buffer size for the UNC made by Aurélien Aptel. Signed-off-by: Thomas Werschlein Signed-off-by: Steve French CC: Tom Talpey Reviewed-by: Aurelien Aptel CC: Stable --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c832a8a..7aa08db 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2547,7 +2547,7 @@ cifs_setup_ipc(struct cifs_ses *ses, struct smb_vol *volume_info) if (tcon == NULL) return -ENOMEM; - snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->serverName); + snprintf(unc, sizeof(unc), "\\\\%s\\IPC$", ses->server->hostname); /* cannot fail */ nls_codepage = load_nls_default();