mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
c346dca108
commit
3b1e0a655f
69 changed files with 253 additions and 215 deletions
|
@ -76,7 +76,7 @@ static struct sock *__raw_v6_lookup(struct net *net, struct sock *sk,
|
|||
if (inet_sk(sk)->num == num) {
|
||||
struct ipv6_pinfo *np = inet6_sk(sk);
|
||||
|
||||
if (sk->sk_net != net)
|
||||
if (sock_net(sk) != net)
|
||||
continue;
|
||||
|
||||
if (!ipv6_addr_any(&np->daddr) &&
|
||||
|
@ -280,7 +280,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
|
|||
if (!sk->sk_bound_dev_if)
|
||||
goto out;
|
||||
|
||||
dev = dev_get_by_index(sk->sk_net, sk->sk_bound_dev_if);
|
||||
dev = dev_get_by_index(sock_net(sk), sk->sk_bound_dev_if);
|
||||
if (!dev) {
|
||||
err = -ENODEV;
|
||||
goto out;
|
||||
|
@ -293,7 +293,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
|
|||
v4addr = LOOPBACK4_IPV6;
|
||||
if (!(addr_type & IPV6_ADDR_MULTICAST)) {
|
||||
err = -EADDRNOTAVAIL;
|
||||
if (!ipv6_chk_addr(sk->sk_net, &addr->sin6_addr,
|
||||
if (!ipv6_chk_addr(sock_net(sk), &addr->sin6_addr,
|
||||
dev, 0)) {
|
||||
if (dev)
|
||||
dev_put(dev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue