diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/af_inet.c | 6 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 6 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 8 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 2 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 14 | ||||
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 4 | ||||
-rw-r--r-- | net/ipv4/inet_hashtables.c | 8 | ||||
-rw-r--r-- | net/ipv4/inet_timewait_sock.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 4 | ||||
-rw-r--r-- | net/ipv4/ip_sockglue.c | 6 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 16 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 16 | ||||
-rw-r--r-- | net/ipv4/raw.c | 12 | ||||
-rw-r--r-- | net/ipv4/route.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 14 | ||||
-rw-r--r-- | net/ipv4/udp.c | 16 |
18 files changed, 72 insertions, 72 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 06cfb0bed631..5882a1316441 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -464,7 +464,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
464 | if (addr_len < sizeof(struct sockaddr_in)) | 464 | if (addr_len < sizeof(struct sockaddr_in)) |
465 | goto out; | 465 | goto out; |
466 | 466 | ||
467 | chk_addr_ret = inet_addr_type(sk->sk_net, addr->sin_addr.s_addr); | 467 | chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); |
468 | 468 | ||
469 | /* Not specified by any standard per-se, however it breaks too | 469 | /* Not specified by any standard per-se, however it breaks too |
470 | * many applications when removed. It is unfortunate since | 470 | * many applications when removed. It is unfortunate since |
@@ -802,7 +802,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
802 | { | 802 | { |
803 | struct sock *sk = sock->sk; | 803 | struct sock *sk = sock->sk; |
804 | int err = 0; | 804 | int err = 0; |
805 | struct net *net = sk->sk_net; | 805 | struct net *net = sock_net(sk); |
806 | 806 | ||
807 | switch (cmd) { | 807 | switch (cmd) { |
808 | case SIOCGSTAMP: | 808 | case SIOCGSTAMP: |
@@ -1132,7 +1132,7 @@ int inet_sk_rebuild_header(struct sock *sk) | |||
1132 | }; | 1132 | }; |
1133 | 1133 | ||
1134 | security_sk_classify_flow(sk, &fl); | 1134 | security_sk_classify_flow(sk, &fl); |
1135 | err = ip_route_output_flow(sk->sk_net, &rt, &fl, sk, 0); | 1135 | err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 0); |
1136 | } | 1136 | } |
1137 | if (!err) | 1137 | if (!err) |
1138 | sk_setup_caps(sk, &rt->u.dst); | 1138 | sk_setup_caps(sk, &rt->u.dst); |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 823c724a8593..6848e4760f34 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -437,7 +437,7 @@ struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, | |||
437 | 437 | ||
438 | static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | 438 | static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
439 | { | 439 | { |
440 | struct net *net = skb->sk->sk_net; | 440 | struct net *net = sock_net(skb->sk); |
441 | struct nlattr *tb[IFA_MAX+1]; | 441 | struct nlattr *tb[IFA_MAX+1]; |
442 | struct in_device *in_dev; | 442 | struct in_device *in_dev; |
443 | struct ifaddrmsg *ifm; | 443 | struct ifaddrmsg *ifm; |
@@ -552,7 +552,7 @@ errout: | |||
552 | 552 | ||
553 | static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | 553 | static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
554 | { | 554 | { |
555 | struct net *net = skb->sk->sk_net; | 555 | struct net *net = sock_net(skb->sk); |
556 | struct in_ifaddr *ifa; | 556 | struct in_ifaddr *ifa; |
557 | 557 | ||
558 | ASSERT_RTNL(); | 558 | ASSERT_RTNL(); |
@@ -1158,7 +1158,7 @@ nla_put_failure: | |||
1158 | 1158 | ||
1159 | static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) | 1159 | static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) |
1160 | { | 1160 | { |
1161 | struct net *net = skb->sk->sk_net; | 1161 | struct net *net = sock_net(skb->sk); |
1162 | int idx, ip_idx; | 1162 | int idx, ip_idx; |
1163 | struct net_device *dev; | 1163 | struct net_device *dev; |
1164 | struct in_device *in_dev; | 1164 | struct in_device *in_dev; |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 0e4b34b07cb5..0f1557a4ac7a 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -583,7 +583,7 @@ errout: | |||
583 | 583 | ||
584 | static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 584 | static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
585 | { | 585 | { |
586 | struct net *net = skb->sk->sk_net; | 586 | struct net *net = sock_net(skb->sk); |
587 | struct fib_config cfg; | 587 | struct fib_config cfg; |
588 | struct fib_table *tb; | 588 | struct fib_table *tb; |
589 | int err; | 589 | int err; |
@@ -605,7 +605,7 @@ errout: | |||
605 | 605 | ||
606 | static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 606 | static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
607 | { | 607 | { |
608 | struct net *net = skb->sk->sk_net; | 608 | struct net *net = sock_net(skb->sk); |
609 | struct fib_config cfg; | 609 | struct fib_config cfg; |
610 | struct fib_table *tb; | 610 | struct fib_table *tb; |
611 | int err; | 611 | int err; |
@@ -627,7 +627,7 @@ errout: | |||
627 | 627 | ||
628 | static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) | 628 | static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) |
629 | { | 629 | { |
630 | struct net *net = skb->sk->sk_net; | 630 | struct net *net = sock_net(skb->sk); |
631 | unsigned int h, s_h; | 631 | unsigned int h, s_h; |
632 | unsigned int e = 0, s_e; | 632 | unsigned int e = 0, s_e; |
633 | struct fib_table *tb; | 633 | struct fib_table *tb; |
@@ -857,7 +857,7 @@ static void nl_fib_input(struct sk_buff *skb) | |||
857 | struct fib_table *tb; | 857 | struct fib_table *tb; |
858 | u32 pid; | 858 | u32 pid; |
859 | 859 | ||
860 | net = skb->sk->sk_net; | 860 | net = sock_net(skb->sk); |
861 | nlh = nlmsg_hdr(skb); | 861 | nlh = nlmsg_hdr(skb); |
862 | if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || | 862 | if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || |
863 | nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) | 863 | nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 19274d01afa4..1fb56876be54 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -137,7 +137,7 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, | |||
137 | struct nlmsghdr *nlh, struct fib_rule_hdr *frh, | 137 | struct nlmsghdr *nlh, struct fib_rule_hdr *frh, |
138 | struct nlattr **tb) | 138 | struct nlattr **tb) |
139 | { | 139 | { |
140 | struct net *net = skb->sk->sk_net; | 140 | struct net *net = sock_net(skb->sk); |
141 | int err = -EINVAL; | 141 | int err = -EINVAL; |
142 | struct fib4_rule *rule4 = (struct fib4_rule *) rule; | 142 | struct fib4_rule *rule4 = (struct fib4_rule *) rule; |
143 | 143 | ||
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 682f632bfb77..6250f4239b61 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1762,7 +1762,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) | |||
1762 | if (!ipv4_is_multicast(addr)) | 1762 | if (!ipv4_is_multicast(addr)) |
1763 | return -EINVAL; | 1763 | return -EINVAL; |
1764 | 1764 | ||
1765 | if (sk->sk_net != &init_net) | 1765 | if (sock_net(sk) != &init_net) |
1766 | return -EPROTONOSUPPORT; | 1766 | return -EPROTONOSUPPORT; |
1767 | 1767 | ||
1768 | rtnl_lock(); | 1768 | rtnl_lock(); |
@@ -1833,7 +1833,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) | |||
1833 | u32 ifindex; | 1833 | u32 ifindex; |
1834 | int ret = -EADDRNOTAVAIL; | 1834 | int ret = -EADDRNOTAVAIL; |
1835 | 1835 | ||
1836 | if (sk->sk_net != &init_net) | 1836 | if (sock_net(sk) != &init_net) |
1837 | return -EPROTONOSUPPORT; | 1837 | return -EPROTONOSUPPORT; |
1838 | 1838 | ||
1839 | rtnl_lock(); | 1839 | rtnl_lock(); |
@@ -1881,7 +1881,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct | |||
1881 | if (!ipv4_is_multicast(addr)) | 1881 | if (!ipv4_is_multicast(addr)) |
1882 | return -EINVAL; | 1882 | return -EINVAL; |
1883 | 1883 | ||
1884 | if (sk->sk_net != &init_net) | 1884 | if (sock_net(sk) != &init_net) |
1885 | return -EPROTONOSUPPORT; | 1885 | return -EPROTONOSUPPORT; |
1886 | 1886 | ||
1887 | rtnl_lock(); | 1887 | rtnl_lock(); |
@@ -2017,7 +2017,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) | |||
2017 | msf->imsf_fmode != MCAST_EXCLUDE) | 2017 | msf->imsf_fmode != MCAST_EXCLUDE) |
2018 | return -EINVAL; | 2018 | return -EINVAL; |
2019 | 2019 | ||
2020 | if (sk->sk_net != &init_net) | 2020 | if (sock_net(sk) != &init_net) |
2021 | return -EPROTONOSUPPORT; | 2021 | return -EPROTONOSUPPORT; |
2022 | 2022 | ||
2023 | rtnl_lock(); | 2023 | rtnl_lock(); |
@@ -2100,7 +2100,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, | |||
2100 | if (!ipv4_is_multicast(addr)) | 2100 | if (!ipv4_is_multicast(addr)) |
2101 | return -EINVAL; | 2101 | return -EINVAL; |
2102 | 2102 | ||
2103 | if (sk->sk_net != &init_net) | 2103 | if (sock_net(sk) != &init_net) |
2104 | return -EPROTONOSUPPORT; | 2104 | return -EPROTONOSUPPORT; |
2105 | 2105 | ||
2106 | rtnl_lock(); | 2106 | rtnl_lock(); |
@@ -2165,7 +2165,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, | |||
2165 | if (!ipv4_is_multicast(addr)) | 2165 | if (!ipv4_is_multicast(addr)) |
2166 | return -EINVAL; | 2166 | return -EINVAL; |
2167 | 2167 | ||
2168 | if (sk->sk_net != &init_net) | 2168 | if (sock_net(sk) != &init_net) |
2169 | return -EPROTONOSUPPORT; | 2169 | return -EPROTONOSUPPORT; |
2170 | 2170 | ||
2171 | rtnl_lock(); | 2171 | rtnl_lock(); |
@@ -2252,7 +2252,7 @@ void ip_mc_drop_socket(struct sock *sk) | |||
2252 | if (inet->mc_list == NULL) | 2252 | if (inet->mc_list == NULL) |
2253 | return; | 2253 | return; |
2254 | 2254 | ||
2255 | if (sk->sk_net != &init_net) | 2255 | if (sock_net(sk) != &init_net) |
2256 | return; | 2256 | return; |
2257 | 2257 | ||
2258 | rtnl_lock(); | 2258 | rtnl_lock(); |
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index d13c5f12bb32..a7fcaf205644 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -85,7 +85,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum) | |||
85 | struct hlist_node *node; | 85 | struct hlist_node *node; |
86 | struct inet_bind_bucket *tb; | 86 | struct inet_bind_bucket *tb; |
87 | int ret; | 87 | int ret; |
88 | struct net *net = sk->sk_net; | 88 | struct net *net = sock_net(sk); |
89 | 89 | ||
90 | local_bh_disable(); | 90 | local_bh_disable(); |
91 | if (!snum) { | 91 | if (!snum) { |
@@ -333,7 +333,7 @@ struct dst_entry* inet_csk_route_req(struct sock *sk, | |||
333 | .dport = ireq->rmt_port } } }; | 333 | .dport = ireq->rmt_port } } }; |
334 | 334 | ||
335 | security_req_classify_flow(req, &fl); | 335 | security_req_classify_flow(req, &fl); |
336 | if (ip_route_output_flow(sk->sk_net, &rt, &fl, sk, 0)) { | 336 | if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 0)) { |
337 | IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); | 337 | IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); |
338 | return NULL; | 338 | return NULL; |
339 | } | 339 | } |
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 8cd1ad9b9111..1064111e5b96 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c | |||
@@ -139,7 +139,7 @@ static struct sock *inet_lookup_listener_slow(struct net *net, | |||
139 | sk_for_each(sk, node, head) { | 139 | sk_for_each(sk, node, head) { |
140 | const struct inet_sock *inet = inet_sk(sk); | 140 | const struct inet_sock *inet = inet_sk(sk); |
141 | 141 | ||
142 | if (sk->sk_net == net && inet->num == hnum && | 142 | if (sock_net(sk) == net && inet->num == hnum && |
143 | !ipv6_only_sock(sk)) { | 143 | !ipv6_only_sock(sk)) { |
144 | const __be32 rcv_saddr = inet->rcv_saddr; | 144 | const __be32 rcv_saddr = inet->rcv_saddr; |
145 | int score = sk->sk_family == PF_INET ? 1 : 0; | 145 | int score = sk->sk_family == PF_INET ? 1 : 0; |
@@ -182,7 +182,7 @@ struct sock *__inet_lookup_listener(struct net *net, | |||
182 | if (inet->num == hnum && !sk->sk_node.next && | 182 | if (inet->num == hnum && !sk->sk_node.next && |
183 | (!inet->rcv_saddr || inet->rcv_saddr == daddr) && | 183 | (!inet->rcv_saddr || inet->rcv_saddr == daddr) && |
184 | (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) && | 184 | (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) && |
185 | !sk->sk_bound_dev_if && sk->sk_net == net) | 185 | !sk->sk_bound_dev_if && sock_net(sk) == net) |
186 | goto sherry_cache; | 186 | goto sherry_cache; |
187 | sk = inet_lookup_listener_slow(net, head, daddr, hnum, dif); | 187 | sk = inet_lookup_listener_slow(net, head, daddr, hnum, dif); |
188 | } | 188 | } |
@@ -254,7 +254,7 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row, | |||
254 | struct sock *sk2; | 254 | struct sock *sk2; |
255 | const struct hlist_node *node; | 255 | const struct hlist_node *node; |
256 | struct inet_timewait_sock *tw; | 256 | struct inet_timewait_sock *tw; |
257 | struct net *net = sk->sk_net; | 257 | struct net *net = sock_net(sk); |
258 | 258 | ||
259 | prefetch(head->chain.first); | 259 | prefetch(head->chain.first); |
260 | write_lock(lock); | 260 | write_lock(lock); |
@@ -406,7 +406,7 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row, | |||
406 | struct inet_bind_hashbucket *head; | 406 | struct inet_bind_hashbucket *head; |
407 | struct inet_bind_bucket *tb; | 407 | struct inet_bind_bucket *tb; |
408 | int ret; | 408 | int ret; |
409 | struct net *net = sk->sk_net; | 409 | struct net *net = sock_net(sk); |
410 | 410 | ||
411 | if (!snum) { | 411 | if (!snum) { |
412 | int i, remaining, low, high, port; | 412 | int i, remaining, low, high, port; |
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 717c411a5c6b..f12bc24de46f 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
@@ -124,7 +124,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat | |||
124 | tw->tw_hash = sk->sk_hash; | 124 | tw->tw_hash = sk->sk_hash; |
125 | tw->tw_ipv6only = 0; | 125 | tw->tw_ipv6only = 0; |
126 | tw->tw_prot = sk->sk_prot_creator; | 126 | tw->tw_prot = sk->sk_prot_creator; |
127 | tw->tw_net = sk->sk_net; | 127 | twsk_net_set(tw, sock_net(sk)); |
128 | atomic_set(&tw->tw_refcnt, 1); | 128 | atomic_set(&tw->tw_refcnt, 1); |
129 | inet_twsk_dead_node_init(tw); | 129 | inet_twsk_dead_node_init(tw); |
130 | __module_get(tw->tw_prot->owner); | 130 | __module_get(tw->tw_prot->owner); |
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 26685c83a146..4be00959b748 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -172,7 +172,7 @@ int ip_call_ra_chain(struct sk_buff *skb) | |||
172 | if (sk && inet_sk(sk)->num == protocol && | 172 | if (sk && inet_sk(sk)->num == protocol && |
173 | (!sk->sk_bound_dev_if || | 173 | (!sk->sk_bound_dev_if || |
174 | sk->sk_bound_dev_if == dev->ifindex) && | 174 | sk->sk_bound_dev_if == dev->ifindex) && |
175 | sk->sk_net == dev_net(dev)) { | 175 | sock_net(sk) == dev_net(dev)) { |
176 | if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) { | 176 | if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) { |
177 | if (ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN)) { | 177 | if (ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN)) { |
178 | read_unlock(&ip_ra_lock); | 178 | read_unlock(&ip_ra_lock); |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 913266cd9902..08349267ceb4 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -351,7 +351,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok) | |||
351 | * itself out. | 351 | * itself out. |
352 | */ | 352 | */ |
353 | security_sk_classify_flow(sk, &fl); | 353 | security_sk_classify_flow(sk, &fl); |
354 | if (ip_route_output_flow(sk->sk_net, &rt, &fl, sk, 0)) | 354 | if (ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 0)) |
355 | goto no_route; | 355 | goto no_route; |
356 | } | 356 | } |
357 | sk_setup_caps(sk, &rt->u.dst); | 357 | sk_setup_caps(sk, &rt->u.dst); |
@@ -1382,7 +1382,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1382 | .dport = tcp_hdr(skb)->source } }, | 1382 | .dport = tcp_hdr(skb)->source } }, |
1383 | .proto = sk->sk_protocol }; | 1383 | .proto = sk->sk_protocol }; |
1384 | security_skb_classify_flow(skb, &fl); | 1384 | security_skb_classify_flow(skb, &fl); |
1385 | if (ip_route_output_key(sk->sk_net, &rt, &fl)) | 1385 | if (ip_route_output_key(sock_net(sk), &rt, &fl)) |
1386 | return; | 1386 | return; |
1387 | } | 1387 | } |
1388 | 1388 | ||
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index b854431047a4..d6e76f5229cc 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -449,7 +449,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
449 | struct ip_options * opt = NULL; | 449 | struct ip_options * opt = NULL; |
450 | if (optlen > 40 || optlen < 0) | 450 | if (optlen > 40 || optlen < 0) |
451 | goto e_inval; | 451 | goto e_inval; |
452 | err = ip_options_get_from_user(sk->sk_net, &opt, | 452 | err = ip_options_get_from_user(sock_net(sk), &opt, |
453 | optval, optlen); | 453 | optval, optlen); |
454 | if (err) | 454 | if (err) |
455 | break; | 455 | break; |
@@ -590,13 +590,13 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
590 | err = 0; | 590 | err = 0; |
591 | break; | 591 | break; |
592 | } | 592 | } |
593 | dev = ip_dev_find(sk->sk_net, mreq.imr_address.s_addr); | 593 | dev = ip_dev_find(sock_net(sk), mreq.imr_address.s_addr); |
594 | if (dev) { | 594 | if (dev) { |
595 | mreq.imr_ifindex = dev->ifindex; | 595 | mreq.imr_ifindex = dev->ifindex; |
596 | dev_put(dev); | 596 | dev_put(dev); |
597 | } | 597 | } |
598 | } else | 598 | } else |
599 | dev = __dev_get_by_index(sk->sk_net, mreq.imr_ifindex); | 599 | dev = __dev_get_by_index(sock_net(sk), mreq.imr_ifindex); |
600 | 600 | ||
601 | 601 | ||
602 | err = -EADDRNOTAVAIL; | 602 | err = -EADDRNOTAVAIL; |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index e54bc1364473..11700a4dcd95 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -849,7 +849,7 @@ static void mrtsock_destruct(struct sock *sk) | |||
849 | { | 849 | { |
850 | rtnl_lock(); | 850 | rtnl_lock(); |
851 | if (sk == mroute_socket) { | 851 | if (sk == mroute_socket) { |
852 | IPV4_DEVCONF_ALL(sk->sk_net, MC_FORWARDING)--; | 852 | IPV4_DEVCONF_ALL(sock_net(sk), MC_FORWARDING)--; |
853 | 853 | ||
854 | write_lock_bh(&mrt_lock); | 854 | write_lock_bh(&mrt_lock); |
855 | mroute_socket=NULL; | 855 | mroute_socket=NULL; |
@@ -898,7 +898,7 @@ int ip_mroute_setsockopt(struct sock *sk,int optname,char __user *optval,int opt | |||
898 | mroute_socket=sk; | 898 | mroute_socket=sk; |
899 | write_unlock_bh(&mrt_lock); | 899 | write_unlock_bh(&mrt_lock); |
900 | 900 | ||
901 | IPV4_DEVCONF_ALL(sk->sk_net, MC_FORWARDING)++; | 901 | IPV4_DEVCONF_ALL(sock_net(sk), MC_FORWARDING)++; |
902 | } | 902 | } |
903 | rtnl_unlock(); | 903 | rtnl_unlock(); |
904 | return ret; | 904 | return ret; |
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 756bc0e1a7c6..1563f29b5117 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -1496,11 +1496,11 @@ static int compat_do_arpt_set_ctl(struct sock *sk, int cmd, void __user *user, | |||
1496 | 1496 | ||
1497 | switch (cmd) { | 1497 | switch (cmd) { |
1498 | case ARPT_SO_SET_REPLACE: | 1498 | case ARPT_SO_SET_REPLACE: |
1499 | ret = compat_do_replace(sk->sk_net, user, len); | 1499 | ret = compat_do_replace(sock_net(sk), user, len); |
1500 | break; | 1500 | break; |
1501 | 1501 | ||
1502 | case ARPT_SO_SET_ADD_COUNTERS: | 1502 | case ARPT_SO_SET_ADD_COUNTERS: |
1503 | ret = do_add_counters(sk->sk_net, user, len, 1); | 1503 | ret = do_add_counters(sock_net(sk), user, len, 1); |
1504 | break; | 1504 | break; |
1505 | 1505 | ||
1506 | default: | 1506 | default: |
@@ -1644,10 +1644,10 @@ static int compat_do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, | |||
1644 | 1644 | ||
1645 | switch (cmd) { | 1645 | switch (cmd) { |
1646 | case ARPT_SO_GET_INFO: | 1646 | case ARPT_SO_GET_INFO: |
1647 | ret = get_info(sk->sk_net, user, len, 1); | 1647 | ret = get_info(sock_net(sk), user, len, 1); |
1648 | break; | 1648 | break; |
1649 | case ARPT_SO_GET_ENTRIES: | 1649 | case ARPT_SO_GET_ENTRIES: |
1650 | ret = compat_get_entries(sk->sk_net, user, len); | 1650 | ret = compat_get_entries(sock_net(sk), user, len); |
1651 | break; | 1651 | break; |
1652 | default: | 1652 | default: |
1653 | ret = do_arpt_get_ctl(sk, cmd, user, len); | 1653 | ret = do_arpt_get_ctl(sk, cmd, user, len); |
@@ -1665,11 +1665,11 @@ static int do_arpt_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned | |||
1665 | 1665 | ||
1666 | switch (cmd) { | 1666 | switch (cmd) { |
1667 | case ARPT_SO_SET_REPLACE: | 1667 | case ARPT_SO_SET_REPLACE: |
1668 | ret = do_replace(sk->sk_net, user, len); | 1668 | ret = do_replace(sock_net(sk), user, len); |
1669 | break; | 1669 | break; |
1670 | 1670 | ||
1671 | case ARPT_SO_SET_ADD_COUNTERS: | 1671 | case ARPT_SO_SET_ADD_COUNTERS: |
1672 | ret = do_add_counters(sk->sk_net, user, len, 0); | 1672 | ret = do_add_counters(sock_net(sk), user, len, 0); |
1673 | break; | 1673 | break; |
1674 | 1674 | ||
1675 | default: | 1675 | default: |
@@ -1689,11 +1689,11 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len | |||
1689 | 1689 | ||
1690 | switch (cmd) { | 1690 | switch (cmd) { |
1691 | case ARPT_SO_GET_INFO: | 1691 | case ARPT_SO_GET_INFO: |
1692 | ret = get_info(sk->sk_net, user, len, 0); | 1692 | ret = get_info(sock_net(sk), user, len, 0); |
1693 | break; | 1693 | break; |
1694 | 1694 | ||
1695 | case ARPT_SO_GET_ENTRIES: | 1695 | case ARPT_SO_GET_ENTRIES: |
1696 | ret = get_entries(sk->sk_net, user, len); | 1696 | ret = get_entries(sock_net(sk), user, len); |
1697 | break; | 1697 | break; |
1698 | 1698 | ||
1699 | case ARPT_SO_GET_REVISION_TARGET: { | 1699 | case ARPT_SO_GET_REVISION_TARGET: { |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 85a75e186b4b..a819d191e1aa 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -1852,11 +1852,11 @@ compat_do_ipt_set_ctl(struct sock *sk, int cmd, void __user *user, | |||
1852 | 1852 | ||
1853 | switch (cmd) { | 1853 | switch (cmd) { |
1854 | case IPT_SO_SET_REPLACE: | 1854 | case IPT_SO_SET_REPLACE: |
1855 | ret = compat_do_replace(sk->sk_net, user, len); | 1855 | ret = compat_do_replace(sock_net(sk), user, len); |
1856 | break; | 1856 | break; |
1857 | 1857 | ||
1858 | case IPT_SO_SET_ADD_COUNTERS: | 1858 | case IPT_SO_SET_ADD_COUNTERS: |
1859 | ret = do_add_counters(sk->sk_net, user, len, 1); | 1859 | ret = do_add_counters(sock_net(sk), user, len, 1); |
1860 | break; | 1860 | break; |
1861 | 1861 | ||
1862 | default: | 1862 | default: |
@@ -1963,10 +1963,10 @@ compat_do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) | |||
1963 | 1963 | ||
1964 | switch (cmd) { | 1964 | switch (cmd) { |
1965 | case IPT_SO_GET_INFO: | 1965 | case IPT_SO_GET_INFO: |
1966 | ret = get_info(sk->sk_net, user, len, 1); | 1966 | ret = get_info(sock_net(sk), user, len, 1); |
1967 | break; | 1967 | break; |
1968 | case IPT_SO_GET_ENTRIES: | 1968 | case IPT_SO_GET_ENTRIES: |
1969 | ret = compat_get_entries(sk->sk_net, user, len); | 1969 | ret = compat_get_entries(sock_net(sk), user, len); |
1970 | break; | 1970 | break; |
1971 | default: | 1971 | default: |
1972 | ret = do_ipt_get_ctl(sk, cmd, user, len); | 1972 | ret = do_ipt_get_ctl(sk, cmd, user, len); |
@@ -1985,11 +1985,11 @@ do_ipt_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len) | |||
1985 | 1985 | ||
1986 | switch (cmd) { | 1986 | switch (cmd) { |
1987 | case IPT_SO_SET_REPLACE: | 1987 | case IPT_SO_SET_REPLACE: |
1988 | ret = do_replace(sk->sk_net, user, len); | 1988 | ret = do_replace(sock_net(sk), user, len); |
1989 | break; | 1989 | break; |
1990 | 1990 | ||
1991 | case IPT_SO_SET_ADD_COUNTERS: | 1991 | case IPT_SO_SET_ADD_COUNTERS: |
1992 | ret = do_add_counters(sk->sk_net, user, len, 0); | 1992 | ret = do_add_counters(sock_net(sk), user, len, 0); |
1993 | break; | 1993 | break; |
1994 | 1994 | ||
1995 | default: | 1995 | default: |
@@ -2010,11 +2010,11 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) | |||
2010 | 2010 | ||
2011 | switch (cmd) { | 2011 | switch (cmd) { |
2012 | case IPT_SO_GET_INFO: | 2012 | case IPT_SO_GET_INFO: |
2013 | ret = get_info(sk->sk_net, user, len, 0); | 2013 | ret = get_info(sock_net(sk), user, len, 0); |
2014 | break; | 2014 | break; |
2015 | 2015 | ||
2016 | case IPT_SO_GET_ENTRIES: | 2016 | case IPT_SO_GET_ENTRIES: |
2017 | ret = get_entries(sk->sk_net, user, len); | 2017 | ret = get_entries(sock_net(sk), user, len); |
2018 | break; | 2018 | break; |
2019 | 2019 | ||
2020 | case IPT_SO_GET_REVISION_MATCH: | 2020 | case IPT_SO_GET_REVISION_MATCH: |
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]); |
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) |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 28bece6f281b..46847e600a46 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1486,7 +1486,7 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) | |||
1486 | if (req) | 1486 | if (req) |
1487 | return tcp_check_req(sk, skb, req, prev); | 1487 | return tcp_check_req(sk, skb, req, prev); |
1488 | 1488 | ||
1489 | nsk = inet_lookup_established(sk->sk_net, &tcp_hashinfo, iph->saddr, | 1489 | nsk = inet_lookup_established(sock_net(sk), &tcp_hashinfo, iph->saddr, |
1490 | th->source, iph->daddr, th->dest, inet_iif(skb)); | 1490 | th->source, iph->daddr, th->dest, inet_iif(skb)); |
1491 | 1491 | ||
1492 | if (nsk) { | 1492 | if (nsk) { |
@@ -1974,7 +1974,7 @@ static void *listening_get_next(struct seq_file *seq, void *cur) | |||
1974 | while (1) { | 1974 | while (1) { |
1975 | while (req) { | 1975 | while (req) { |
1976 | if (req->rsk_ops->family == st->family && | 1976 | if (req->rsk_ops->family == st->family && |
1977 | req->sk->sk_net == net) { | 1977 | sock_net(req->sk) == net) { |
1978 | cur = req; | 1978 | cur = req; |
1979 | goto out; | 1979 | goto out; |
1980 | } | 1980 | } |
@@ -1998,7 +1998,7 @@ get_req: | |||
1998 | } | 1998 | } |
1999 | get_sk: | 1999 | get_sk: |
2000 | sk_for_each_from(sk, node) { | 2000 | sk_for_each_from(sk, node) { |
2001 | if (sk->sk_family == st->family && sk->sk_net == net) { | 2001 | if (sk->sk_family == st->family && sock_net(sk) == net) { |
2002 | cur = sk; | 2002 | cur = sk; |
2003 | goto out; | 2003 | goto out; |
2004 | } | 2004 | } |
@@ -2049,7 +2049,7 @@ static void *established_get_first(struct seq_file *seq) | |||
2049 | read_lock_bh(lock); | 2049 | read_lock_bh(lock); |
2050 | sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) { | 2050 | sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) { |
2051 | if (sk->sk_family != st->family || | 2051 | if (sk->sk_family != st->family || |
2052 | sk->sk_net != net) { | 2052 | sock_net(sk) != net) { |
2053 | continue; | 2053 | continue; |
2054 | } | 2054 | } |
2055 | rc = sk; | 2055 | rc = sk; |
@@ -2059,7 +2059,7 @@ static void *established_get_first(struct seq_file *seq) | |||
2059 | inet_twsk_for_each(tw, node, | 2059 | inet_twsk_for_each(tw, node, |
2060 | &tcp_hashinfo.ehash[st->bucket].twchain) { | 2060 | &tcp_hashinfo.ehash[st->bucket].twchain) { |
2061 | if (tw->tw_family != st->family || | 2061 | if (tw->tw_family != st->family || |
2062 | tw->tw_net != net) { | 2062 | twsk_net(tw) != net) { |
2063 | continue; | 2063 | continue; |
2064 | } | 2064 | } |
2065 | rc = tw; | 2065 | rc = tw; |
@@ -2086,7 +2086,7 @@ static void *established_get_next(struct seq_file *seq, void *cur) | |||
2086 | tw = cur; | 2086 | tw = cur; |
2087 | tw = tw_next(tw); | 2087 | tw = tw_next(tw); |
2088 | get_tw: | 2088 | get_tw: |
2089 | while (tw && (tw->tw_family != st->family || tw->tw_net != net)) { | 2089 | while (tw && (tw->tw_family != st->family || twsk_net(tw) != net)) { |
2090 | tw = tw_next(tw); | 2090 | tw = tw_next(tw); |
2091 | } | 2091 | } |
2092 | if (tw) { | 2092 | if (tw) { |
@@ -2107,7 +2107,7 @@ get_tw: | |||
2107 | sk = sk_next(sk); | 2107 | sk = sk_next(sk); |
2108 | 2108 | ||
2109 | sk_for_each_from(sk, node) { | 2109 | sk_for_each_from(sk, node) { |
2110 | if (sk->sk_family == st->family && sk->sk_net == net) | 2110 | if (sk->sk_family == st->family && sock_net(sk) == net) |
2111 | goto found; | 2111 | goto found; |
2112 | } | 2112 | } |
2113 | 2113 | ||
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index e2cd93481359..76d52d37d6ac 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -137,7 +137,7 @@ static inline int __udp_lib_lport_inuse(struct net *net, __u16 num, | |||
137 | struct hlist_node *node; | 137 | struct hlist_node *node; |
138 | 138 | ||
139 | sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)]) | 139 | sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)]) |
140 | if (sk->sk_net == net && sk->sk_hash == num) | 140 | if (sock_net(sk) == net && sk->sk_hash == num) |
141 | return 1; | 141 | return 1; |
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
@@ -158,7 +158,7 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum, | |||
158 | struct hlist_head *head; | 158 | struct hlist_head *head; |
159 | struct sock *sk2; | 159 | struct sock *sk2; |
160 | int error = 1; | 160 | int error = 1; |
161 | struct net *net = sk->sk_net; | 161 | struct net *net = sock_net(sk); |
162 | 162 | ||
163 | write_lock_bh(&udp_hash_lock); | 163 | write_lock_bh(&udp_hash_lock); |
164 | 164 | ||
@@ -218,7 +218,7 @@ gotit: | |||
218 | sk_for_each(sk2, node, head) | 218 | sk_for_each(sk2, node, head) |
219 | if (sk2->sk_hash == snum && | 219 | if (sk2->sk_hash == snum && |
220 | sk2 != sk && | 220 | sk2 != sk && |
221 | sk2->sk_net == net && | 221 | sock_net(sk2) == net && |
222 | (!sk2->sk_reuse || !sk->sk_reuse) && | 222 | (!sk2->sk_reuse || !sk->sk_reuse) && |
223 | (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if | 223 | (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if |
224 | || sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && | 224 | || sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && |
@@ -269,7 +269,7 @@ static struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, | |||
269 | sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) { | 269 | sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) { |
270 | struct inet_sock *inet = inet_sk(sk); | 270 | struct inet_sock *inet = inet_sk(sk); |
271 | 271 | ||
272 | if (sk->sk_net == net && sk->sk_hash == hnum && | 272 | if (sock_net(sk) == net && sk->sk_hash == hnum && |
273 | !ipv6_only_sock(sk)) { | 273 | !ipv6_only_sock(sk)) { |
274 | int score = (sk->sk_family == PF_INET ? 1 : 0); | 274 | int score = (sk->sk_family == PF_INET ? 1 : 0); |
275 | if (inet->rcv_saddr) { | 275 | if (inet->rcv_saddr) { |
@@ -607,7 +607,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
607 | 607 | ||
608 | ipc.oif = sk->sk_bound_dev_if; | 608 | ipc.oif = sk->sk_bound_dev_if; |
609 | if (msg->msg_controllen) { | 609 | if (msg->msg_controllen) { |
610 | err = ip_cmsg_send(sk->sk_net, msg, &ipc); | 610 | err = ip_cmsg_send(sock_net(sk), msg, &ipc); |
611 | if (err) | 611 | if (err) |
612 | return err; | 612 | return err; |
613 | if (ipc.opt) | 613 | if (ipc.opt) |
@@ -656,7 +656,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
656 | { .sport = inet->sport, | 656 | { .sport = inet->sport, |
657 | .dport = dport } } }; | 657 | .dport = dport } } }; |
658 | security_sk_classify_flow(sk, &fl); | 658 | security_sk_classify_flow(sk, &fl); |
659 | err = ip_route_output_flow(sk->sk_net, &rt, &fl, sk, 1); | 659 | err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 1); |
660 | if (err) { | 660 | if (err) { |
661 | if (err == -ENETUNREACH) | 661 | if (err == -ENETUNREACH) |
662 | IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); | 662 | IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES); |
@@ -1511,7 +1511,7 @@ static struct sock *udp_get_first(struct seq_file *seq) | |||
1511 | for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { | 1511 | for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { |
1512 | struct hlist_node *node; | 1512 | struct hlist_node *node; |
1513 | sk_for_each(sk, node, state->hashtable + state->bucket) { | 1513 | sk_for_each(sk, node, state->hashtable + state->bucket) { |
1514 | if (sk->sk_net != net) | 1514 | if (sock_net(sk) != net) |
1515 | continue; | 1515 | continue; |
1516 | if (sk->sk_family == state->family) | 1516 | if (sk->sk_family == state->family) |
1517 | goto found; | 1517 | goto found; |
@@ -1531,7 +1531,7 @@ static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk) | |||
1531 | sk = sk_next(sk); | 1531 | sk = sk_next(sk); |
1532 | try_again: | 1532 | try_again: |
1533 | ; | 1533 | ; |
1534 | } while (sk && (sk->sk_net != net || sk->sk_family != state->family)); | 1534 | } while (sk && (sock_net(sk) != net || sk->sk_family != state->family)); |
1535 | 1535 | ||
1536 | if (!sk && ++state->bucket < UDP_HTABLE_SIZE) { | 1536 | if (!sk && ++state->bucket < UDP_HTABLE_SIZE) { |
1537 | sk = sk_head(state->hashtable + state->bucket); | 1537 | sk = sk_head(state->hashtable + state->bucket); |