aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-01-13 04:09:11 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 19:28:11 -0500
commit8b147f74738d9ab7e76085e5535e0fe8dc8b29f4 (patch)
treeef970b0447d676b5d2a13117bb20750134749eb7
parent3065f1e29aa2716c8903cfeff368df4b5314040a (diff)
SUNRPC: parametrize rpc_pton6() by network context
Parametrize rpc_pton6() by network context and thus force it's caller to pass in network context instead of using hard-coded "init_net". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--net/sunrpc/addr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c
index cc83de1c2224..18c40a2002fb 100644
--- a/net/sunrpc/addr.c
+++ b/net/sunrpc/addr.c
@@ -198,7 +198,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf,
198 return 0; 198 return 0;
199} 199}
200 200
201static size_t rpc_pton6(const char *buf, const size_t buflen, 201static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen,
202 struct sockaddr *sap, const size_t salen) 202 struct sockaddr *sap, const size_t salen)
203{ 203{
204 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; 204 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
@@ -214,14 +214,14 @@ static size_t rpc_pton6(const char *buf, const size_t buflen,
214 if (in6_pton(buf, buflen, addr, IPV6_SCOPE_DELIMITER, &delim) == 0) 214 if (in6_pton(buf, buflen, addr, IPV6_SCOPE_DELIMITER, &delim) == 0)
215 return 0; 215 return 0;
216 216
217 if (!rpc_parse_scope_id(&init_net, buf, buflen, delim, sin6)) 217 if (!rpc_parse_scope_id(net, buf, buflen, delim, sin6))
218 return 0; 218 return 0;
219 219
220 sin6->sin6_family = AF_INET6; 220 sin6->sin6_family = AF_INET6;
221 return sizeof(struct sockaddr_in6); 221 return sizeof(struct sockaddr_in6);
222} 222}
223#else 223#else
224static size_t rpc_pton6(const char *buf, const size_t buflen, 224static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen,
225 struct sockaddr *sap, const size_t salen) 225 struct sockaddr *sap, const size_t salen)
226{ 226{
227 return 0; 227 return 0;
@@ -249,7 +249,7 @@ size_t rpc_pton(const char *buf, const size_t buflen,
249 249
250 for (i = 0; i < buflen; i++) 250 for (i = 0; i < buflen; i++)
251 if (buf[i] == ':') 251 if (buf[i] == ':')
252 return rpc_pton6(buf, buflen, sap, salen); 252 return rpc_pton6(&init_net, buf, buflen, sap, salen);
253 return rpc_pton4(buf, buflen, sap, salen); 253 return rpc_pton4(buf, buflen, sap, salen);
254} 254}
255EXPORT_SYMBOL_GPL(rpc_pton); 255EXPORT_SYMBOL_GPL(rpc_pton);