diff options
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r-- | net/ipv4/raw.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 8756d502a47f..be19a4048d7c 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -117,7 +117,7 @@ static struct sock *__raw_v4_lookup(struct net *net, struct sock *sk, | |||
117 | sk_for_each_from(sk, node) { | 117 | sk_for_each_from(sk, node) { |
118 | struct inet_sock *inet = inet_sk(sk); | 118 | struct inet_sock *inet = inet_sk(sk); |
119 | 119 | ||
120 | if (sk->sk_net == net && inet->num == num && | 120 | if (sock_net(sk) == net && inet->num == num && |
121 | !(inet->daddr && inet->daddr != raddr) && | 121 | !(inet->daddr && inet->daddr != raddr) && |
122 | !(inet->rcv_saddr && inet->rcv_saddr != laddr) && | 122 | !(inet->rcv_saddr && inet->rcv_saddr != laddr) && |
123 | !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)) | 123 | !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)) |
@@ -499,7 +499,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
499 | ipc.oif = sk->sk_bound_dev_if; | 499 | ipc.oif = sk->sk_bound_dev_if; |
500 | 500 | ||
501 | if (msg->msg_controllen) { | 501 | if (msg->msg_controllen) { |
502 | err = ip_cmsg_send(sk->sk_net, msg, &ipc); | 502 | err = ip_cmsg_send(sock_net(sk), msg, &ipc); |
503 | if (err) | 503 | if (err) |
504 | goto out; | 504 | goto out; |
505 | if (ipc.opt) | 505 | if (ipc.opt) |
@@ -553,7 +553,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
553 | } | 553 | } |
554 | 554 | ||
555 | security_sk_classify_flow(sk, &fl); | 555 | security_sk_classify_flow(sk, &fl); |
556 | err = ip_route_output_flow(sk->sk_net, &rt, &fl, sk, 1); | 556 | err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 1); |
557 | } | 557 | } |
558 | if (err) | 558 | if (err) |
559 | goto done; | 559 | goto done; |
@@ -620,7 +620,7 @@ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
620 | 620 | ||
621 | if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_in)) | 621 | if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_in)) |
622 | goto out; | 622 | goto out; |
623 | chk_addr_ret = inet_addr_type(sk->sk_net, addr->sin_addr.s_addr); | 623 | chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); |
624 | ret = -EADDRNOTAVAIL; | 624 | ret = -EADDRNOTAVAIL; |
625 | if (addr->sin_addr.s_addr && chk_addr_ret != RTN_LOCAL && | 625 | if (addr->sin_addr.s_addr && chk_addr_ret != RTN_LOCAL && |
626 | chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST) | 626 | chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST) |
@@ -856,7 +856,7 @@ static struct sock *raw_get_first(struct seq_file *seq) | |||
856 | struct hlist_node *node; | 856 | struct hlist_node *node; |
857 | 857 | ||
858 | sk_for_each(sk, node, &state->h->ht[state->bucket]) | 858 | sk_for_each(sk, node, &state->h->ht[state->bucket]) |
859 | if (sk->sk_net == state->p.net) | 859 | if (sock_net(sk) == state->p.net) |
860 | goto found; | 860 | goto found; |
861 | } | 861 | } |
862 | sk = NULL; | 862 | sk = NULL; |
@@ -872,7 +872,7 @@ static struct sock *raw_get_next(struct seq_file *seq, struct sock *sk) | |||
872 | sk = sk_next(sk); | 872 | sk = sk_next(sk); |
873 | try_again: | 873 | try_again: |
874 | ; | 874 | ; |
875 | } while (sk && sk->sk_net != state->p.net); | 875 | } while (sk && sock_net(sk) != state->p.net); |
876 | 876 | ||
877 | if (!sk && ++state->bucket < RAW_HTABLE_SIZE) { | 877 | if (!sk && ++state->bucket < RAW_HTABLE_SIZE) { |
878 | sk = sk_head(&state->h->ht[state->bucket]); | 878 | sk = sk_head(&state->h->ht[state->bucket]); |