diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2012-06-08 01:21:40 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-08 14:27:23 -0700 |
commit | 54db0cc2ba0d38166acc2d6bae21721405305537 (patch) | |
tree | 9c067a1e7be7e3f2c862b3d64568ba330a0e0b2c /include/net/inetpeer.h | |
parent | c8a627ed06d6d49bf65015a2185c519335c4c83f (diff) | |
download | talos-obmc-linux-54db0cc2ba0d38166acc2d6bae21721405305537.tar.gz talos-obmc-linux-54db0cc2ba0d38166acc2d6bae21721405305537.zip |
inetpeer: add parameter net for inet_getpeer_v4,v6
add struct net as a parameter of inet_getpeer_v[4,6],
use net to replace &init_net.
and modify some places to provide net for inet_getpeer_v[4,6]
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inetpeer.h')
-rw-r--r-- | include/net/inetpeer.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index fef9dfab5d45..20e67db69ac9 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h @@ -79,22 +79,26 @@ struct inet_peer *inet_getpeer(struct net *net, const struct inetpeer_addr *daddr, int create); -static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) +static inline struct inet_peer *inet_getpeer_v4(struct net *net, + __be32 v4daddr, + int create) { struct inetpeer_addr daddr; daddr.addr.a4 = v4daddr; daddr.family = AF_INET; - return inet_getpeer(&init_net, &daddr, create); + return inet_getpeer(net, &daddr, create); } -static inline struct inet_peer *inet_getpeer_v6(const struct in6_addr *v6daddr, int create) +static inline struct inet_peer *inet_getpeer_v6(struct net *net, + const struct in6_addr *v6daddr, + int create) { struct inetpeer_addr daddr; *(struct in6_addr *)daddr.addr.a6 = *v6daddr; daddr.family = AF_INET6; - return inet_getpeer(&init_net, &daddr, create); + return inet_getpeer(net, &daddr, create); } /* can be called from BH context or outside */ |