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/raw.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/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index efb0047f6880..12c7a1560977 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -76,7 +76,7 @@ static struct sock *__raw_v6_lookup(struct net *net, struct sock *sk, | |||
76 | if (inet_sk(sk)->num == num) { | 76 | if (inet_sk(sk)->num == num) { |
77 | struct ipv6_pinfo *np = inet6_sk(sk); | 77 | struct ipv6_pinfo *np = inet6_sk(sk); |
78 | 78 | ||
79 | if (sk->sk_net != net) | 79 | if (sock_net(sk) != net) |
80 | continue; | 80 | continue; |
81 | 81 | ||
82 | if (!ipv6_addr_any(&np->daddr) && | 82 | if (!ipv6_addr_any(&np->daddr) && |
@@ -280,7 +280,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
280 | if (!sk->sk_bound_dev_if) | 280 | if (!sk->sk_bound_dev_if) |
281 | goto out; | 281 | goto out; |
282 | 282 | ||
283 | dev = dev_get_by_index(sk->sk_net, sk->sk_bound_dev_if); | 283 | dev = dev_get_by_index(sock_net(sk), sk->sk_bound_dev_if); |
284 | if (!dev) { | 284 | if (!dev) { |
285 | err = -ENODEV; | 285 | err = -ENODEV; |
286 | goto out; | 286 | goto out; |
@@ -293,7 +293,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
293 | v4addr = LOOPBACK4_IPV6; | 293 | v4addr = LOOPBACK4_IPV6; |
294 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { | 294 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { |
295 | err = -EADDRNOTAVAIL; | 295 | err = -EADDRNOTAVAIL; |
296 | if (!ipv6_chk_addr(sk->sk_net, &addr->sin6_addr, | 296 | if (!ipv6_chk_addr(sock_net(sk), &addr->sin6_addr, |
297 | dev, 0)) { | 297 | dev, 0)) { |
298 | if (dev) | 298 | if (dev) |
299 | dev_put(dev); | 299 | dev_put(dev); |