From patchwork Thu Aug 30 16:29:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Werschlein X-Patchwork-Id: 10582275 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C653B13AC for ; Thu, 30 Aug 2018 16:29:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B43DE2C122 for ; Thu, 30 Aug 2018 16:29:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7BD32C126; Thu, 30 Aug 2018 16:29:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 995352C122 for ; Thu, 30 Aug 2018 16:29:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727193AbeH3UcU convert rfc822-to-8bit (ORCPT ); Thu, 30 Aug 2018 16:32:20 -0400 Received: from mx02.geo.uzh.ch ([130.60.176.136]:57988 "EHLO mx02.geo.uzh.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbeH3UcT (ORCPT ); Thu, 30 Aug 2018 16:32:19 -0400 X-Virus-Scanned: Debian amavisd-new at geo.uzh.ch Received: from smtp.geo.uzh.ch (smtp.geo.uzh.ch [130.60.176.101]) by mx02.geo.uzh.ch (Postfix) with SMTP id 5DCAE260D4F for ; Thu, 30 Aug 2018 18:29:21 +0200 (CEST) Received: (qmail 25200 invoked from network); 30 Aug 2018 16:29:21 -0000 Received: (ofmipd 130.60.16.242); 30 Aug 2018 16:28:59 -0000 Date: 30 Aug 2018 18:29:20 +0200 Message-Id: From: "Thomas Werschlein" To: "CIFS" Cc: "Steve French" , " =?utf-8?q?Aur=C3=A9lien_Aptel?= " , "Tom Talpey" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: [PATCH] cifs: connect to servername instead of IP for IPC$ share In-Reply-To: <87lg8s6ro7.fsf@suse.com> References: <87lg8s6ro7.fsf@suse.com> X-Mailer: Apple Mail (2.3445.9.1) Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This change corresponds to the buffer size for the UNC (Aurélien Aptel), prevents authentication to be forced down to NTLM (Tom Talpey) and allows access to a Microsoft fileserver failover cluster behind a 1:1 NAT firewall. Signed-off-by: Thomas Werschlein Reviewed-by: Aurelien Aptel --- fs/cifs/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c832a8a1970a..7aa08dba4719 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();