From patchwork Wed Jun 22 21:36:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 907392 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5MLbAGS025401 for ; Wed, 22 Jun 2011 21:37:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758951Ab1FVVhR (ORCPT ); Wed, 22 Jun 2011 17:37:17 -0400 Received: from mail.candelatech.com ([208.74.158.172]:50595 "EHLO ns3.lanforge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758920Ab1FVVhQ (ORCPT ); Wed, 22 Jun 2011 17:37:16 -0400 Received: from fs3.candelatech.com (firewall.candelatech.com [70.89.124.249]) by ns3.lanforge.com (8.14.2/8.14.2) with ESMTP id p5MLb4k8013400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2011 14:37:05 -0700 From: greearb@candelatech.com To: linux-nfs@vger.kernel.org Cc: Ben Greear Subject: [PATCH 01/11] sunrpc: Don't attempt to bind to AF_UNSPEC address. Date: Wed, 22 Jun 2011 14:36:41 -0700 Message-Id: <1308778611-9370-2-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1308778611-9370-1-git-send-email-greearb@candelatech.com> References: <1308778611-9370-1-git-send-email-greearb@candelatech.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Jun 2011 21:37:18 +0000 (UTC) From: Ben Greear This lets calling code simply pass AF_UNSPEC addresses instead of adding lots of checks to conditionally pass NULL addresses. Signed-off-by: Ben Greear --- :100644 100644 72abb73... 37299c0... M net/sunrpc/xprtsock.c net/sunrpc/xprtsock.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 72abb73..37299c0 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2509,9 +2509,9 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args, new = container_of(xprt, struct sock_xprt, xprt); memcpy(&xprt->addr, args->dstaddr, args->addrlen); xprt->addrlen = args->addrlen; - if (args->srcaddr) + if (args->srcaddr && (args->srcaddr->sa_family != AF_UNSPEC)) { memcpy(&new->srcaddr, args->srcaddr, args->addrlen); - else { + } else { int err; err = xs_init_anyaddr(args->dstaddr->sa_family, (struct sockaddr *)&new->srcaddr);