[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101101195631.9279.16018.stgit@matisse.1015granger.net>
Date: Mon, 01 Nov 2010 15:58:21 -0400
From: Chuck Lever <chuck.lever@...cle.com>
To: nbowler@...iptictech.com
Cc: linux-kernel@...r.kernel.org, linux-nfs@...r.kernel.org
Subject: [PATCH] SUNRPC: Initialize source address if passed-in srcaddr is
AF_UNSPEC
Recently xs_bind() was changed so it can't tolerate an AF_UNSPEC
bind address; it needs a fully initialized ANYADDR. We recently fixed
this case in xprtsock.c, but some upper layer protocols seem to assume
that it's OK to pass in an AF_UNSPEC address for the source address.
Catch that case too.
Signed-off-by: Chuck Lever <chuck.lever@...cle.com>
---
Untested.
net/sunrpc/xprtsock.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index dfcab5a..fd6484b 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2181,7 +2181,7 @@ 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 {
int err;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists