lkml.org 
[lkml]   [2011]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH (RESEND) 06/12] nfs: Use srcaddr in nfs_match_client.
Date
From: Ben Greear <greearb@candelatech.com>

For bound clients, we have to make sure we do not re-use
a client that is bound differently.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 c571a97... 5d8998a... M fs/nfs/client.c
fs/nfs/client.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index c571a97..5d8998a 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -131,7 +131,9 @@ struct rpc_program nfsacl_program = {
struct nfs_client_initdata {
const char *hostname;
const struct sockaddr *addr;
+ const struct sockaddr *srcaddr;
size_t addrlen;
+ size_t srcaddrlen;
const struct nfs_rpc_ops *rpc_ops;
int proto;
u32 minorversion;
@@ -463,6 +465,9 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat

list_for_each_entry(clp, &nfs_client_list, cl_share_link) {
const struct sockaddr *clap = (struct sockaddr *)&clp->cl_addr;
+ const struct sockaddr *sa;
+ sa = (const struct sockaddr *)&clp->srcaddr;
+
/* Don't match clients that failed to initialise properly */
if (clp->cl_cons_state < 0)
continue;
@@ -480,6 +485,13 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat
if (!nfs_sockaddr_cmp(sap, clap))
continue;

+ /* Check to make sure local-IP bindings match,
+ * but just the IP-addr.
+ */
+ if (data->srcaddr &&
+ !nfs_sockaddr_match_ipaddr(data->srcaddr, sa))
+ continue;
+
atomic_inc(&clp->cl_count);
return clp;
}
--
1.7.3.4


\
 
 \ /
  Last update: 2011-07-15 20:01    [W:0.098 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site