From patchwork Mon Jun 1 08:37:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simo Leone X-Patchwork-Id: 27172 Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n518c9DH030865 for ; Mon, 1 Jun 2009 08:38:09 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 50E67163C4A for ; Mon, 1 Jun 2009 08:37:38 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.8 tests=BAYES_00, DNS_FROM_RFC_POST, FORGED_RCVD_HELO,SPF_PASS autolearn=no version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-pz0-f196.google.com (mail-pz0-f196.google.com [209.85.222.196]) by lists.samba.org (Postfix) with ESMTP id D047E163BD7 for ; Mon, 1 Jun 2009 08:37:21 +0000 (GMT) Received: by pzk34 with SMTP id 34so2531708pzk.10 for ; Mon, 01 Jun 2009 01:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:from:to:cc :subject:date:message-id:x-mailer; bh=mXi3Y5gDisskFgqSKJP+BQU/+OCXzSAoynsEyXpUIJE=; b=nEbxalAwQBcOWqoKQmYHLcw6YcLKW3oMaPX0e80VqOsXw4tPPOFTo9eNEfUdfUQR3W ESTBHyKF+dpUv7VdLPW5Dm4sWe96/dpi6pu3nh1xfdOrgWtFU+999my2rRaf9RTor4gW /o1GbTDiwtmocsnsvtzUmIfes1cXaBFHLGwLA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=McYA9Tr5RhUeN3iZFe2GpNGglaiHzXU+2blEW4qhgJxEhSG4jr8FfUvV/nGEv7Xule wK6epU3pjuSg/TyF4wmg8DxKiD6WTFUVyaGJrh4fTR77RQXjCHcOjgsK5XfHFfRkJVEY CaK4rrZoyJeDdU+3Ux4M1LCx5/LRGuzg5PsI4= Received: by 10.143.4.11 with SMTP id g11mr1921084wfi.340.1243845471088; Mon, 01 Jun 2009 01:37:51 -0700 (PDT) Received: from redshift.neotuli.net ([76.14.56.127]) by mx.google.com with ESMTPS id 28sm8285633wfg.5.2009.06.01.01.37.49 (version=SSLv3 cipher=RC4-MD5); Mon, 01 Jun 2009 01:37:50 -0700 (PDT) Received: by redshift.neotuli.net (sSMTP sendmail emulation); Mon, 01 Jun 2009 01:37:50 -0700 From: Simo Leone To: linux-cifs-client@lists.samba.org Date: Mon, 1 Jun 2009 01:37:50 -0700 Message-Id: <1243845470-22619-1-git-send-email-simo@archlinux.org> X-Mailer: git-send-email 1.6.3.1 Cc: Simo Leone Subject: [linux-cifs-client] [PATCH] cifs: Fix port overriding X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Errors-To: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Copy struct *after* setting the port, instead of before. Signed-off-by: Simo Leone Acked-by: Jeff Layton --- fs/cifs/connect.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0344b26..6462071 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1506,14 +1506,14 @@ cifs_get_tcp_session(struct smb_vol *volume_info) cFYI(1, ("attempting ipv6 connect")); /* BB should we allow ipv6 on port 139? */ /* 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, sizeof(struct sockaddr_in6)); - sin_server6->sin6_port = htons(volume_info->port); rc = ipv6_connect(tcp_ses); } else { + sin_server->sin_port = htons(volume_info->port); memcpy(&tcp_ses->addr.sockAddr, sin_server, sizeof(struct sockaddr_in)); - sin_server->sin_port = htons(volume_info->port); rc = ipv4_connect(tcp_ses); } if (rc < 0) {