diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 13:26:21 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:39:55 -0400 |
commit | 3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch) | |
tree | 09edb35f32ebcfb1b4dad904425128a110ef16ee /net/ipv6/addrconf.c | |
parent | c346dca10840a874240c78efe3f39acf4312a1f2 (diff) |
[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
Introduce per-sock inlines: sock_net(), sock_net_set()
and per-inet_timewait_sock inlines: twsk_net(), twsk_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index d1de9ec74261..f2c90f145cbb 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -3054,7 +3054,7 @@ static const struct nla_policy ifa_ipv6_policy[IFA_MAX+1] = { | |||
3054 | static int | 3054 | static int |
3055 | inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | 3055 | inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
3056 | { | 3056 | { |
3057 | struct net *net = skb->sk->sk_net; | 3057 | struct net *net = sock_net(skb->sk); |
3058 | struct ifaddrmsg *ifm; | 3058 | struct ifaddrmsg *ifm; |
3059 | struct nlattr *tb[IFA_MAX+1]; | 3059 | struct nlattr *tb[IFA_MAX+1]; |
3060 | struct in6_addr *pfx; | 3060 | struct in6_addr *pfx; |
@@ -3112,7 +3112,7 @@ static int inet6_addr_modify(struct inet6_ifaddr *ifp, u8 ifa_flags, | |||
3112 | static int | 3112 | static int |
3113 | inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | 3113 | inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
3114 | { | 3114 | { |
3115 | struct net *net = skb->sk->sk_net; | 3115 | struct net *net = sock_net(skb->sk); |
3116 | struct ifaddrmsg *ifm; | 3116 | struct ifaddrmsg *ifm; |
3117 | struct nlattr *tb[IFA_MAX+1]; | 3117 | struct nlattr *tb[IFA_MAX+1]; |
3118 | struct in6_addr *pfx; | 3118 | struct in6_addr *pfx; |
@@ -3322,7 +3322,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, | |||
3322 | struct inet6_ifaddr *ifa; | 3322 | struct inet6_ifaddr *ifa; |
3323 | struct ifmcaddr6 *ifmca; | 3323 | struct ifmcaddr6 *ifmca; |
3324 | struct ifacaddr6 *ifaca; | 3324 | struct ifacaddr6 *ifaca; |
3325 | struct net *net = skb->sk->sk_net; | 3325 | struct net *net = sock_net(skb->sk); |
3326 | 3326 | ||
3327 | s_idx = cb->args[0]; | 3327 | s_idx = cb->args[0]; |
3328 | s_ip_idx = ip_idx = cb->args[1]; | 3328 | s_ip_idx = ip_idx = cb->args[1]; |
@@ -3418,7 +3418,7 @@ static int inet6_dump_ifacaddr(struct sk_buff *skb, struct netlink_callback *cb) | |||
3418 | static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr* nlh, | 3418 | static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr* nlh, |
3419 | void *arg) | 3419 | void *arg) |
3420 | { | 3420 | { |
3421 | struct net *net = in_skb->sk->sk_net; | 3421 | struct net *net = sock_net(in_skb->sk); |
3422 | struct ifaddrmsg *ifm; | 3422 | struct ifaddrmsg *ifm; |
3423 | struct nlattr *tb[IFA_MAX+1]; | 3423 | struct nlattr *tb[IFA_MAX+1]; |
3424 | struct in6_addr *addr = NULL; | 3424 | struct in6_addr *addr = NULL; |
@@ -3645,7 +3645,7 @@ nla_put_failure: | |||
3645 | 3645 | ||
3646 | static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) | 3646 | static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) |
3647 | { | 3647 | { |
3648 | struct net *net = skb->sk->sk_net; | 3648 | struct net *net = sock_net(skb->sk); |
3649 | int idx, err; | 3649 | int idx, err; |
3650 | int s_idx = cb->args[0]; | 3650 | int s_idx = cb->args[0]; |
3651 | struct net_device *dev; | 3651 | struct net_device *dev; |