aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/dns_resolve.c4
-rw-r--r--fs/nfs/nfs4filelayoutdev.c2
-rw-r--r--fs/nfs/nfs4namespace.c2
-rw-r--r--fs/nfs/super.c4
-rw-r--r--fs/nfsd/nfsctl.c2
-rw-r--r--include/linux/sunrpc/clnt.h2
-rw-r--r--net/sunrpc/addr.c7
-rw-r--r--net/sunrpc/svcauth_unix.c2
8 files changed, 13 insertions, 12 deletions
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index 200eb67c95d9..7edc62a8a64f 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -20,7 +20,7 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
20 20
21 ip_len = dns_query(NULL, name, namelen, NULL, &ip_addr, NULL); 21 ip_len = dns_query(NULL, name, namelen, NULL, &ip_addr, NULL);
22 if (ip_len > 0) 22 if (ip_len > 0)
23 ret = rpc_pton(ip_addr, ip_len, sa, salen); 23 ret = rpc_pton(&init_net, ip_addr, ip_len, sa, salen);
24 else 24 else
25 ret = -ESRCH; 25 ret = -ESRCH;
26 kfree(ip_addr); 26 kfree(ip_addr);
@@ -224,7 +224,7 @@ static int nfs_dns_parse(struct cache_detail *cd, char *buf, int buflen)
224 len = qword_get(&buf, buf1, sizeof(buf1)); 224 len = qword_get(&buf, buf1, sizeof(buf1));
225 if (len <= 0) 225 if (len <= 0)
226 goto out; 226 goto out;
227 key.addrlen = rpc_pton(buf1, len, 227 key.addrlen = rpc_pton(&init_net, buf1, len,
228 (struct sockaddr *)&key.addr, 228 (struct sockaddr *)&key.addr,
229 sizeof(key.addr)); 229 sizeof(key.addr));
230 230
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index 8ae91908f5aa..0d8b9523a3cb 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -457,7 +457,7 @@ decode_ds_addr(struct xdr_stream *streamp, gfp_t gfp_flags)
457 457
458 INIT_LIST_HEAD(&da->da_node); 458 INIT_LIST_HEAD(&da->da_node);
459 459
460 if (!rpc_pton(buf, portstr-buf, (struct sockaddr *)&da->da_addr, 460 if (!rpc_pton(&init_net, buf, portstr-buf, (struct sockaddr *)&da->da_addr,
461 sizeof(da->da_addr))) { 461 sizeof(da->da_addr))) {
462 dprintk("%s: error parsing address %s\n", __func__, buf); 462 dprintk("%s: error parsing address %s\n", __func__, buf);
463 goto out_free_da; 463 goto out_free_da;
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index 919a36935924..48a9acdbaeb6 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -98,7 +98,7 @@ static size_t nfs_parse_server_name(char *string, size_t len,
98{ 98{
99 ssize_t ret; 99 ssize_t ret;
100 100
101 ret = rpc_pton(string, len, sa, salen); 101 ret = rpc_pton(&init_net, string, len, sa, salen);
102 if (ret == 0) { 102 if (ret == 0) {
103 ret = nfs_dns_resolve_name(server->client->cl_xprt->xprt_net, 103 ret = nfs_dns_resolve_name(server->client->cl_xprt->xprt_net,
104 string, len, sa, salen); 104 string, len, sa, salen);
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index e45feb0fee59..b79f2a11c29e 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1408,7 +1408,7 @@ static int nfs_parse_mount_options(char *raw,
1408 if (string == NULL) 1408 if (string == NULL)
1409 goto out_nomem; 1409 goto out_nomem;
1410 mnt->nfs_server.addrlen = 1410 mnt->nfs_server.addrlen =
1411 rpc_pton(string, strlen(string), 1411 rpc_pton(&init_net, string, strlen(string),
1412 (struct sockaddr *) 1412 (struct sockaddr *)
1413 &mnt->nfs_server.address, 1413 &mnt->nfs_server.address,
1414 sizeof(mnt->nfs_server.address)); 1414 sizeof(mnt->nfs_server.address));
@@ -1430,7 +1430,7 @@ static int nfs_parse_mount_options(char *raw,
1430 if (string == NULL) 1430 if (string == NULL)
1431 goto out_nomem; 1431 goto out_nomem;
1432 mnt->mount_server.addrlen = 1432 mnt->mount_server.addrlen =
1433 rpc_pton(string, strlen(string), 1433 rpc_pton(&init_net, string, strlen(string),
1434 (struct sockaddr *) 1434 (struct sockaddr *)
1435 &mnt->mount_server.address, 1435 &mnt->mount_server.address,
1436 sizeof(mnt->mount_server.address)); 1436 sizeof(mnt->mount_server.address));
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 748eda93ce59..330352d379b6 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -223,7 +223,7 @@ static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size)
223 if (qword_get(&buf, fo_path, size) < 0) 223 if (qword_get(&buf, fo_path, size) < 0)
224 return -EINVAL; 224 return -EINVAL;
225 225
226 if (rpc_pton(fo_path, size, sap, salen) == 0) 226 if (rpc_pton(&init_net, fo_path, size, sap, salen) == 0)
227 return -EINVAL; 227 return -EINVAL;
228 228
229 return nlmsvc_unlock_all_by_ip(sap); 229 return nlmsvc_unlock_all_by_ip(sap);
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index e891a8a18cb3..7bd114fc84e3 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -163,7 +163,7 @@ size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
163const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); 163const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
164 164
165size_t rpc_ntop(const struct sockaddr *, char *, const size_t); 165size_t rpc_ntop(const struct sockaddr *, char *, const size_t);
166size_t rpc_pton(const char *, const size_t, 166size_t rpc_pton(struct net *, const char *, const size_t,
167 struct sockaddr *, const size_t); 167 struct sockaddr *, const size_t);
168char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); 168char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t);
169size_t rpc_uaddr2sockaddr(const char *, const size_t, 169size_t rpc_uaddr2sockaddr(const char *, const size_t,
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c
index 18c40a2002fb..82b06b73c1e1 100644
--- a/net/sunrpc/addr.c
+++ b/net/sunrpc/addr.c
@@ -230,6 +230,7 @@ static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen,
230 230
231/** 231/**
232 * rpc_pton - Construct a sockaddr in @sap 232 * rpc_pton - Construct a sockaddr in @sap
233 * @net: applicable network namespace
233 * @buf: C string containing presentation format IP address 234 * @buf: C string containing presentation format IP address
234 * @buflen: length of presentation address in bytes 235 * @buflen: length of presentation address in bytes
235 * @sap: buffer into which to plant socket address 236 * @sap: buffer into which to plant socket address
@@ -242,14 +243,14 @@ static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen,
242 * socket address, if successful. Returns zero if an error 243 * socket address, if successful. Returns zero if an error
243 * occurred. 244 * occurred.
244 */ 245 */
245size_t rpc_pton(const char *buf, const size_t buflen, 246size_t rpc_pton(struct net *net, const char *buf, const size_t buflen,
246 struct sockaddr *sap, const size_t salen) 247 struct sockaddr *sap, const size_t salen)
247{ 248{
248 unsigned int i; 249 unsigned int i;
249 250
250 for (i = 0; i < buflen; i++) 251 for (i = 0; i < buflen; i++)
251 if (buf[i] == ':') 252 if (buf[i] == ':')
252 return rpc_pton6(&init_net, buf, buflen, sap, salen); 253 return rpc_pton6(net, buf, buflen, sap, salen);
253 return rpc_pton4(buf, buflen, sap, salen); 254 return rpc_pton4(buf, buflen, sap, salen);
254} 255}
255EXPORT_SYMBOL_GPL(rpc_pton); 256EXPORT_SYMBOL_GPL(rpc_pton);
@@ -340,7 +341,7 @@ size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len,
340 port = (unsigned short)((porthi << 8) | portlo); 341 port = (unsigned short)((porthi << 8) | portlo);
341 342
342 *c = '\0'; 343 *c = '\0';
343 if (rpc_pton(buf, strlen(buf), sap, salen) == 0) 344 if (rpc_pton(&init_net, buf, strlen(buf), sap, salen) == 0)
344 return 0; 345 return 0;
345 346
346 switch (sap->sa_family) { 347 switch (sap->sa_family) {
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 01153ead1dba..2f8c426c1384 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -211,7 +211,7 @@ static int ip_map_parse(struct cache_detail *cd,
211 len = qword_get(&mesg, buf, mlen); 211 len = qword_get(&mesg, buf, mlen);
212 if (len <= 0) return -EINVAL; 212 if (len <= 0) return -EINVAL;
213 213
214 if (rpc_pton(buf, len, &address.sa, sizeof(address)) == 0) 214 if (rpc_pton(&init_net, buf, len, &address.sa, sizeof(address)) == 0)
215 return -EINVAL; 215 return -EINVAL;
216 switch (address.sa.sa_family) { 216 switch (address.sa.sa_family) {
217 case AF_INET: 217 case AF_INET: