aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-09-03 14:35:54 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-09-29 18:13:39 -0400
commit7e9d7746bfd40121438b155023793796499497d8 (patch)
tree1b2ba4e1a32d22485bcec946ef4fb6f758067a3a /fs/lockd
parent90151e6e4d00a3150d03d52170c246734b274622 (diff)
NSM: Use sockaddr_storage for sm_addr field
To store larger addresses in the nsm_handle structure, make sm_addr a sockaddr_storage. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/host.c5
-rw-r--r--fs/lockd/mon.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 3ce2702d0368..510ebcf485f0 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -551,7 +551,7 @@ retry:
551 if (strlen(pos->sm_name) != hostname_len 551 if (strlen(pos->sm_name) != hostname_len
552 || memcmp(pos->sm_name, hostname, hostname_len)) 552 || memcmp(pos->sm_name, hostname, hostname_len))
553 continue; 553 continue;
554 } else if (!nlm_cmp_addr(&pos->sm_addr, sin)) 554 } else if (!nlm_cmp_addr(nsm_addr_in(pos), sin))
555 continue; 555 continue;
556 atomic_inc(&pos->sm_count); 556 atomic_inc(&pos->sm_count);
557 kfree(nsm); 557 kfree(nsm);
@@ -571,7 +571,8 @@ retry:
571 if (nsm == NULL) 571 if (nsm == NULL)
572 return NULL; 572 return NULL;
573 573
574 nsm->sm_addr = *sin; 574 memcpy(nsm_addr(nsm), sin, sizeof(*sin));
575 nsm->sm_addrlen = sizeof(*sin);
575 nsm->sm_name = (char *) (nsm + 1); 576 nsm->sm_name = (char *) (nsm + 1);
576 memcpy(nsm->sm_name, hostname, hostname_len); 577 memcpy(nsm->sm_name, hostname, hostname_len);
577 nsm->sm_name[hostname_len] = '\0'; 578 nsm->sm_name[hostname_len] = '\0';
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index e4d563543b11..4e7e958e8f67 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -51,7 +51,7 @@ nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
51 51
52 memset(&args, 0, sizeof(args)); 52 memset(&args, 0, sizeof(args));
53 args.mon_name = nsm->sm_name; 53 args.mon_name = nsm->sm_name;
54 args.addr = nsm->sm_addr.sin_addr.s_addr; 54 args.addr = nsm_addr_in(nsm)->sin_addr.s_addr;
55 args.prog = NLM_PROGRAM; 55 args.prog = NLM_PROGRAM;
56 args.vers = 3; 56 args.vers = 3;
57 args.proc = NLMPROC_NSM_NOTIFY; 57 args.proc = NLMPROC_NSM_NOTIFY;