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/ipv4/route.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/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 7768d718e199..194f5cca3121 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2689,7 +2689,7 @@ nla_put_failure: | |||
2689 | 2689 | ||
2690 | static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) | 2690 | static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) |
2691 | { | 2691 | { |
2692 | struct net *net = in_skb->sk->sk_net; | 2692 | struct net *net = sock_net(in_skb->sk); |
2693 | struct rtmsg *rtm; | 2693 | struct rtmsg *rtm; |
2694 | struct nlattr *tb[RTA_MAX+1]; | 2694 | struct nlattr *tb[RTA_MAX+1]; |
2695 | struct rtable *rt = NULL; | 2695 | struct rtable *rt = NULL; |
@@ -2785,7 +2785,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
2785 | int idx, s_idx; | 2785 | int idx, s_idx; |
2786 | struct net *net; | 2786 | struct net *net; |
2787 | 2787 | ||
2788 | net = skb->sk->sk_net; | 2788 | net = sock_net(skb->sk); |
2789 | 2789 | ||
2790 | s_h = cb->args[0]; | 2790 | s_h = cb->args[0]; |
2791 | if (s_h < 0) | 2791 | if (s_h < 0) |