diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 18 | ||||
-rw-r--r-- | fs/nfsd/nfscache.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 7 | ||||
-rw-r--r-- | fs/nfsd/nfsproc.c | 7 | ||||
-rw-r--r-- | fs/nfsd/nfssvc.c | 6 |
5 files changed, 22 insertions, 18 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 9de89df961f4..9e4067999209 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -714,7 +714,7 @@ __be32 | |||
714 | nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | 714 | nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
715 | struct nfsd4_setclientid *setclid) | 715 | struct nfsd4_setclientid *setclid) |
716 | { | 716 | { |
717 | __be32 ip_addr = rqstp->rq_addr.sin_addr.s_addr; | 717 | struct sockaddr_in *sin = svc_addr_in(rqstp); |
718 | struct xdr_netobj clname = { | 718 | struct xdr_netobj clname = { |
719 | .len = setclid->se_namelen, | 719 | .len = setclid->se_namelen, |
720 | .data = setclid->se_name, | 720 | .data = setclid->se_name, |
@@ -749,7 +749,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
749 | */ | 749 | */ |
750 | status = nfserr_clid_inuse; | 750 | status = nfserr_clid_inuse; |
751 | if (!cmp_creds(&conf->cl_cred, &rqstp->rq_cred) | 751 | if (!cmp_creds(&conf->cl_cred, &rqstp->rq_cred) |
752 | || conf->cl_addr != ip_addr) { | 752 | || conf->cl_addr != sin->sin_addr.s_addr) { |
753 | printk("NFSD: setclientid: string in use by client" | 753 | printk("NFSD: setclientid: string in use by client" |
754 | "(clientid %08x/%08x)\n", | 754 | "(clientid %08x/%08x)\n", |
755 | conf->cl_clientid.cl_boot, conf->cl_clientid.cl_id); | 755 | conf->cl_clientid.cl_boot, conf->cl_clientid.cl_id); |
@@ -769,7 +769,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
769 | if (new == NULL) | 769 | if (new == NULL) |
770 | goto out; | 770 | goto out; |
771 | copy_verf(new, &clverifier); | 771 | copy_verf(new, &clverifier); |
772 | new->cl_addr = ip_addr; | 772 | new->cl_addr = sin->sin_addr.s_addr; |
773 | copy_cred(&new->cl_cred,&rqstp->rq_cred); | 773 | copy_cred(&new->cl_cred,&rqstp->rq_cred); |
774 | gen_clid(new); | 774 | gen_clid(new); |
775 | gen_confirm(new); | 775 | gen_confirm(new); |
@@ -801,7 +801,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
801 | if (new == NULL) | 801 | if (new == NULL) |
802 | goto out; | 802 | goto out; |
803 | copy_verf(new,&conf->cl_verifier); | 803 | copy_verf(new,&conf->cl_verifier); |
804 | new->cl_addr = ip_addr; | 804 | new->cl_addr = sin->sin_addr.s_addr; |
805 | copy_cred(&new->cl_cred,&rqstp->rq_cred); | 805 | copy_cred(&new->cl_cred,&rqstp->rq_cred); |
806 | copy_clid(new, conf); | 806 | copy_clid(new, conf); |
807 | gen_confirm(new); | 807 | gen_confirm(new); |
@@ -820,7 +820,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
820 | if (new == NULL) | 820 | if (new == NULL) |
821 | goto out; | 821 | goto out; |
822 | copy_verf(new,&clverifier); | 822 | copy_verf(new,&clverifier); |
823 | new->cl_addr = ip_addr; | 823 | new->cl_addr = sin->sin_addr.s_addr; |
824 | copy_cred(&new->cl_cred,&rqstp->rq_cred); | 824 | copy_cred(&new->cl_cred,&rqstp->rq_cred); |
825 | gen_clid(new); | 825 | gen_clid(new); |
826 | gen_confirm(new); | 826 | gen_confirm(new); |
@@ -847,7 +847,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
847 | if (new == NULL) | 847 | if (new == NULL) |
848 | goto out; | 848 | goto out; |
849 | copy_verf(new,&clverifier); | 849 | copy_verf(new,&clverifier); |
850 | new->cl_addr = ip_addr; | 850 | new->cl_addr = sin->sin_addr.s_addr; |
851 | copy_cred(&new->cl_cred,&rqstp->rq_cred); | 851 | copy_cred(&new->cl_cred,&rqstp->rq_cred); |
852 | gen_clid(new); | 852 | gen_clid(new); |
853 | gen_confirm(new); | 853 | gen_confirm(new); |
@@ -881,7 +881,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, | |||
881 | struct nfsd4_compound_state *cstate, | 881 | struct nfsd4_compound_state *cstate, |
882 | struct nfsd4_setclientid_confirm *setclientid_confirm) | 882 | struct nfsd4_setclientid_confirm *setclientid_confirm) |
883 | { | 883 | { |
884 | __be32 ip_addr = rqstp->rq_addr.sin_addr.s_addr; | 884 | struct sockaddr_in *sin = svc_addr_in(rqstp); |
885 | struct nfs4_client *conf, *unconf; | 885 | struct nfs4_client *conf, *unconf; |
886 | nfs4_verifier confirm = setclientid_confirm->sc_confirm; | 886 | nfs4_verifier confirm = setclientid_confirm->sc_confirm; |
887 | clientid_t * clid = &setclientid_confirm->sc_clientid; | 887 | clientid_t * clid = &setclientid_confirm->sc_clientid; |
@@ -900,9 +900,9 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, | |||
900 | unconf = find_unconfirmed_client(clid); | 900 | unconf = find_unconfirmed_client(clid); |
901 | 901 | ||
902 | status = nfserr_clid_inuse; | 902 | status = nfserr_clid_inuse; |
903 | if (conf && conf->cl_addr != ip_addr) | 903 | if (conf && conf->cl_addr != sin->sin_addr.s_addr) |
904 | goto out; | 904 | goto out; |
905 | if (unconf && unconf->cl_addr != ip_addr) | 905 | if (unconf && unconf->cl_addr != sin->sin_addr.s_addr) |
906 | goto out; | 906 | goto out; |
907 | 907 | ||
908 | if ((conf && unconf) && | 908 | if ((conf && unconf) && |
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c index f90d70475854..578f2c9d56be 100644 --- a/fs/nfsd/nfscache.c +++ b/fs/nfsd/nfscache.c | |||
@@ -185,7 +185,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp, int type) | |||
185 | rp->c_state = RC_INPROG; | 185 | rp->c_state = RC_INPROG; |
186 | rp->c_xid = xid; | 186 | rp->c_xid = xid; |
187 | rp->c_proc = proc; | 187 | rp->c_proc = proc; |
188 | rp->c_addr = rqstp->rq_addr; | 188 | memcpy(&rp->c_addr, svc_addr_in(rqstp), sizeof(rp->c_addr)); |
189 | rp->c_prot = proto; | 189 | rp->c_prot = proto; |
190 | rp->c_vers = vers; | 190 | rp->c_vers = vers; |
191 | rp->c_timestamp = jiffies; | 191 | rp->c_timestamp = jiffies; |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index c59d6fbb7a6b..a0b4282cb284 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/mount.h> | 20 | #include <linux/mount.h> |
21 | #include <asm/pgtable.h> | 21 | #include <asm/pgtable.h> |
22 | 22 | ||
23 | #include <linux/sunrpc/clnt.h> | ||
23 | #include <linux/sunrpc/svc.h> | 24 | #include <linux/sunrpc/svc.h> |
24 | #include <linux/nfsd/nfsd.h> | 25 | #include <linux/nfsd/nfsd.h> |
25 | 26 | ||
@@ -180,10 +181,10 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
180 | /* Check if the request originated from a secure port. */ | 181 | /* Check if the request originated from a secure port. */ |
181 | error = nfserr_perm; | 182 | error = nfserr_perm; |
182 | if (!rqstp->rq_secure && EX_SECURE(exp)) { | 183 | if (!rqstp->rq_secure && EX_SECURE(exp)) { |
184 | char buf[RPC_MAX_ADDRBUFLEN]; | ||
183 | printk(KERN_WARNING | 185 | printk(KERN_WARNING |
184 | "nfsd: request from insecure port (%u.%u.%u.%u:%d)!\n", | 186 | "nfsd: request from insecure port %s!\n", |
185 | NIPQUAD(rqstp->rq_addr.sin_addr.s_addr), | 187 | svc_print_addr(rqstp, buf, sizeof(buf))); |
186 | ntohs(rqstp->rq_addr.sin_port)); | ||
187 | goto out; | 188 | goto out; |
188 | } | 189 | } |
189 | 190 | ||
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index ec983b777680..5cc2eec981b8 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/unistd.h> | 19 | #include <linux/unistd.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | 21 | ||
22 | #include <linux/sunrpc/clnt.h> | ||
22 | #include <linux/sunrpc/svc.h> | 23 | #include <linux/sunrpc/svc.h> |
23 | #include <linux/nfsd/nfsd.h> | 24 | #include <linux/nfsd/nfsd.h> |
24 | #include <linux/nfsd/cache.h> | 25 | #include <linux/nfsd/cache.h> |
@@ -147,10 +148,10 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp, | |||
147 | */ | 148 | */ |
148 | 149 | ||
149 | if (NFSSVC_MAXBLKSIZE_V2 < argp->count) { | 150 | if (NFSSVC_MAXBLKSIZE_V2 < argp->count) { |
151 | char buf[RPC_MAX_ADDRBUFLEN]; | ||
150 | printk(KERN_NOTICE | 152 | printk(KERN_NOTICE |
151 | "oversized read request from %u.%u.%u.%u:%d (%d bytes)\n", | 153 | "oversized read request from %s (%d bytes)\n", |
152 | NIPQUAD(rqstp->rq_addr.sin_addr.s_addr), | 154 | svc_print_addr(rqstp, buf, sizeof(buf)), |
153 | ntohs(rqstp->rq_addr.sin_port), | ||
154 | argp->count); | 155 | argp->count); |
155 | argp->count = NFSSVC_MAXBLKSIZE_V2; | 156 | argp->count = NFSSVC_MAXBLKSIZE_V2; |
156 | } | 157 | } |
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index fbf5d51947ea..d7759ce6ed94 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -235,7 +235,8 @@ static int nfsd_init_socks(int port) | |||
235 | 235 | ||
236 | error = lockd_up(IPPROTO_UDP); | 236 | error = lockd_up(IPPROTO_UDP); |
237 | if (error >= 0) { | 237 | if (error >= 0) { |
238 | error = svc_makesock(nfsd_serv, IPPROTO_UDP, port); | 238 | error = svc_makesock(nfsd_serv, IPPROTO_UDP, port, |
239 | SVC_SOCK_DEFAULTS); | ||
239 | if (error < 0) | 240 | if (error < 0) |
240 | lockd_down(); | 241 | lockd_down(); |
241 | } | 242 | } |
@@ -245,7 +246,8 @@ static int nfsd_init_socks(int port) | |||
245 | #ifdef CONFIG_NFSD_TCP | 246 | #ifdef CONFIG_NFSD_TCP |
246 | error = lockd_up(IPPROTO_TCP); | 247 | error = lockd_up(IPPROTO_TCP); |
247 | if (error >= 0) { | 248 | if (error >= 0) { |
248 | error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); | 249 | error = svc_makesock(nfsd_serv, IPPROTO_TCP, port, |
250 | SVC_SOCK_DEFAULTS); | ||
249 | if (error < 0) | 251 | if (error < 0) |
250 | lockd_down(); | 252 | lockd_down(); |
251 | } | 253 | } |