aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/addr.c')
-rw-r--r--net/sunrpc/addr.c7
1 files changed, 4 insertions, 3 deletions
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) {