aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/vrf.c2
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/netfilter.h26
-rw-r--r--include/linux/netfilter_bridge.h2
-rw-r--r--include/net/dn_neigh.h6
-rw-r--r--include/net/dst.h4
-rw-r--r--include/net/ipv6.h2
-rw-r--r--include/net/netfilter/br_netfilter.h2
-rw-r--r--net/bridge/br_forward.c5
-rw-r--r--net/bridge/br_input.c7
-rw-r--r--net/bridge/br_netfilter_hooks.c21
-rw-r--r--net/bridge/br_netfilter_ipv6.c3
-rw-r--r--net/bridge/br_private.h6
-rw-r--r--net/bridge/br_stp_bpdu.c3
-rw-r--r--net/core/dev.c4
-rw-r--r--net/decnet/dn_neigh.c8
-rw-r--r--net/decnet/dn_nsp_in.c3
-rw-r--r--net/decnet/dn_route.c6
-rw-r--r--net/ipv4/arp.c7
-rw-r--r--net/ipv4/ip_forward.c3
-rw-r--r--net/ipv4/ip_input.c7
-rw-r--r--net/ipv4/ip_output.c4
-rw-r--r--net/ipv4/ipmr.c4
-rw-r--r--net/ipv4/raw.c2
-rw-r--r--net/ipv4/xfrm4_input.c3
-rw-r--r--net/ipv4/xfrm4_output.c2
-rw-r--r--net/ipv6/ip6_input.c5
-rw-r--r--net/ipv6/ip6_output.c7
-rw-r--r--net/ipv6/ip6mr.c3
-rw-r--r--net/ipv6/mcast.c4
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/output_core.c2
-rw-r--r--net/ipv6/raw.c2
-rw-r--r--net/ipv6/xfrm6_output.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c4
-rw-r--r--net/netfilter/nf_queue.c2
-rw-r--r--net/xfrm/xfrm_output.c12
37 files changed, 95 insertions, 94 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 979a4db9c6bc..637e9fd1e14c 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -253,7 +253,7 @@ static netdev_tx_t vrf_xmit(struct sk_buff *skb, struct net_device *dev)
253} 253}
254 254
255/* modelled after ip_finish_output2 */ 255/* modelled after ip_finish_output2 */
256static int vrf_finish_output(struct sock *sk, struct sk_buff *skb) 256static int vrf_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb)
257{ 257{
258 struct dst_entry *dst = skb_dst(skb); 258 struct dst_entry *dst = skb_dst(skb);
259 struct rtable *rt = (struct rtable *)dst; 259 struct rtable *rt = (struct rtable *)dst;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 97ab5c9a7069..b791405958b4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2212,7 +2212,7 @@ int dev_open(struct net_device *dev);
2212int dev_close(struct net_device *dev); 2212int dev_close(struct net_device *dev);
2213int dev_close_many(struct list_head *head, bool unlink); 2213int dev_close_many(struct list_head *head, bool unlink);
2214void dev_disable_lro(struct net_device *dev); 2214void dev_disable_lro(struct net_device *dev);
2215int dev_loopback_xmit(struct sock *sk, struct sk_buff *newskb); 2215int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb);
2216int dev_queue_xmit(struct sk_buff *skb); 2216int dev_queue_xmit(struct sk_buff *skb);
2217int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); 2217int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv);
2218int register_netdevice(struct net_device *dev); 2218int register_netdevice(struct net_device *dev);
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 295f2650b5dc..0b4d4560f33d 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -56,7 +56,7 @@ struct nf_hook_state {
56 struct sock *sk; 56 struct sock *sk;
57 struct net *net; 57 struct net *net;
58 struct list_head *hook_list; 58 struct list_head *hook_list;
59 int (*okfn)(struct sock *, struct sk_buff *); 59 int (*okfn)(struct net *, struct sock *, struct sk_buff *);
60}; 60};
61 61
62static inline void nf_hook_state_init(struct nf_hook_state *p, 62static inline void nf_hook_state_init(struct nf_hook_state *p,
@@ -67,7 +67,7 @@ static inline void nf_hook_state_init(struct nf_hook_state *p,
67 struct net_device *outdev, 67 struct net_device *outdev,
68 struct sock *sk, 68 struct sock *sk,
69 struct net *net, 69 struct net *net,
70 int (*okfn)(struct sock *, struct sk_buff *)) 70 int (*okfn)(struct net *, struct sock *, struct sk_buff *))
71{ 71{
72 p->hook = hook; 72 p->hook = hook;
73 p->thresh = thresh; 73 p->thresh = thresh;
@@ -175,7 +175,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
175 struct sk_buff *skb, 175 struct sk_buff *skb,
176 struct net_device *indev, 176 struct net_device *indev,
177 struct net_device *outdev, 177 struct net_device *outdev,
178 int (*okfn)(struct sock *, struct sk_buff *), 178 int (*okfn)(struct net *, struct sock *, struct sk_buff *),
179 int thresh) 179 int thresh)
180{ 180{
181 struct list_head *hook_list = &net->nf.hooks[pf][hook]; 181 struct list_head *hook_list = &net->nf.hooks[pf][hook];
@@ -193,7 +193,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
193static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, 193static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net,
194 struct sock *sk, struct sk_buff *skb, 194 struct sock *sk, struct sk_buff *skb,
195 struct net_device *indev, struct net_device *outdev, 195 struct net_device *indev, struct net_device *outdev,
196 int (*okfn)(struct sock *, struct sk_buff *)) 196 int (*okfn)(struct net *, struct sock *, struct sk_buff *))
197{ 197{
198 return nf_hook_thresh(pf, hook, net, sk, skb, indev, outdev, okfn, INT_MIN); 198 return nf_hook_thresh(pf, hook, net, sk, skb, indev, outdev, okfn, INT_MIN);
199} 199}
@@ -219,31 +219,33 @@ static inline int
219NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, 219NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk,
220 struct sk_buff *skb, struct net_device *in, 220 struct sk_buff *skb, struct net_device *in,
221 struct net_device *out, 221 struct net_device *out,
222 int (*okfn)(struct sock *, struct sk_buff *), int thresh) 222 int (*okfn)(struct net *, struct sock *, struct sk_buff *),
223 int thresh)
223{ 224{
224 int ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, thresh); 225 int ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, thresh);
225 if (ret == 1) 226 if (ret == 1)
226 ret = okfn(sk, skb); 227 ret = okfn(net, sk, skb);
227 return ret; 228 return ret;
228} 229}
229 230
230static inline int 231static inline int
231NF_HOOK_COND(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, 232NF_HOOK_COND(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk,
232 struct sk_buff *skb, struct net_device *in, struct net_device *out, 233 struct sk_buff *skb, struct net_device *in, struct net_device *out,
233 int (*okfn)(struct sock *, struct sk_buff *), bool cond) 234 int (*okfn)(struct net *, struct sock *, struct sk_buff *),
235 bool cond)
234{ 236{
235 int ret; 237 int ret;
236 238
237 if (!cond || 239 if (!cond ||
238 ((ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, INT_MIN)) == 1)) 240 ((ret = nf_hook_thresh(pf, hook, net, sk, skb, in, out, okfn, INT_MIN)) == 1))
239 ret = okfn(sk, skb); 241 ret = okfn(net, sk, skb);
240 return ret; 242 return ret;
241} 243}
242 244
243static inline int 245static inline int
244NF_HOOK(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb, 246NF_HOOK(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, struct sk_buff *skb,
245 struct net_device *in, struct net_device *out, 247 struct net_device *in, struct net_device *out,
246 int (*okfn)(struct sock *, struct sk_buff *)) 248 int (*okfn)(struct net *, struct sock *, struct sk_buff *))
247{ 249{
248 return NF_HOOK_THRESH(pf, hook, net, sk, skb, in, out, okfn, INT_MIN); 250 return NF_HOOK_THRESH(pf, hook, net, sk, skb, in, out, okfn, INT_MIN);
249} 251}
@@ -345,12 +347,12 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
345} 347}
346 348
347#else /* !CONFIG_NETFILTER */ 349#else /* !CONFIG_NETFILTER */
348#define NF_HOOK(pf, hook, net, sk, skb, indev, outdev, okfn) (okfn)(sk, skb) 350#define NF_HOOK(pf, hook, net, sk, skb, indev, outdev, okfn) (okfn)(net, sk, skb)
349#define NF_HOOK_COND(pf, hook, net, sk, skb, indev, outdev, okfn, cond) (okfn)(sk, skb) 351#define NF_HOOK_COND(pf, hook, net, sk, skb, indev, outdev, okfn, cond) (okfn)(net, sk, skb)
350static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, 352static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net,
351 struct sock *sk, struct sk_buff *skb, 353 struct sock *sk, struct sk_buff *skb,
352 struct net_device *indev, struct net_device *outdev, 354 struct net_device *indev, struct net_device *outdev,
353 int (*okfn)(struct sock *, struct sk_buff *)) 355 int (*okfn)(struct net *, struct sock *, struct sk_buff *))
354{ 356{
355 return 1; 357 return 1;
356} 358}
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 2437b8a5d7a9..2ed40c402b5e 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -17,7 +17,7 @@ enum nf_br_hook_priorities {
17 17
18#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) 18#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
19 19
20int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb); 20int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
21 21
22static inline void br_drop_fake_rtable(struct sk_buff *skb) 22static inline void br_drop_fake_rtable(struct sk_buff *skb)
23{ 23{
diff --git a/include/net/dn_neigh.h b/include/net/dn_neigh.h
index d0424269313f..5e902fc3f4eb 100644
--- a/include/net/dn_neigh.h
+++ b/include/net/dn_neigh.h
@@ -18,11 +18,11 @@ struct dn_neigh {
18 18
19void dn_neigh_init(void); 19void dn_neigh_init(void);
20void dn_neigh_cleanup(void); 20void dn_neigh_cleanup(void);
21int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb); 21int dn_neigh_router_hello(struct net *net, struct sock *sk, struct sk_buff *skb);
22int dn_neigh_endnode_hello(struct sock *sk, struct sk_buff *skb); 22int dn_neigh_endnode_hello(struct net *net, struct sock *sk, struct sk_buff *skb);
23void dn_neigh_pointopoint_hello(struct sk_buff *skb); 23void dn_neigh_pointopoint_hello(struct sk_buff *skb);
24int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n); 24int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n);
25int dn_to_neigh_output(struct sock *sk, struct sk_buff *skb); 25int dn_to_neigh_output(struct net *net, struct sock *sk, struct sk_buff *skb);
26 26
27extern struct neigh_table dn_neigh_table; 27extern struct neigh_table dn_neigh_table;
28 28
diff --git a/include/net/dst.h b/include/net/dst.h
index c72e58474e52..df0481a07029 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -458,6 +458,10 @@ static inline int dst_output(struct sock *sk, struct sk_buff *skb)
458{ 458{
459 return skb_dst(skb)->output(sk, skb); 459 return skb_dst(skb)->output(sk, skb);
460} 460}
461static inline int dst_output_okfn(struct net *net, struct sock *sk, struct sk_buff *skb)
462{
463 return dst_output(sk, skb);
464}
461 465
462/* Input packet from network to transport. */ 466/* Input packet from network to transport. */
463static inline int dst_input(struct sk_buff *skb) 467static inline int dst_input(struct sk_buff *skb)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 711cca428cc8..384a93cf07d6 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -807,7 +807,7 @@ static inline u8 ip6_tclass(__be32 flowinfo)
807int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, 807int ipv6_rcv(struct sk_buff *skb, struct net_device *dev,
808 struct packet_type *pt, struct net_device *orig_dev); 808 struct packet_type *pt, struct net_device *orig_dev);
809 809
810int ip6_rcv_finish(struct sock *sk, struct sk_buff *skb); 810int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
811 811
812/* 812/*
813 * upper-layer output functions 813 * upper-layer output functions
diff --git a/include/net/netfilter/br_netfilter.h b/include/net/netfilter/br_netfilter.h
index d4c6b5f30acd..8fe266504900 100644
--- a/include/net/netfilter/br_netfilter.h
+++ b/include/net/netfilter/br_netfilter.h
@@ -31,7 +31,7 @@ static inline void nf_bridge_push_encap_header(struct sk_buff *skb)
31 skb->network_header -= len; 31 skb->network_header -= len;
32} 32}
33 33
34int br_nf_pre_routing_finish_bridge(struct sock *sk, struct sk_buff *skb); 34int br_nf_pre_routing_finish_bridge(struct net *net, struct sock *sk, struct sk_buff *skb);
35 35
36static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) 36static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
37{ 37{
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 2dd2a23ce707..48afca729ed7 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -35,7 +35,7 @@ static inline int should_deliver(const struct net_bridge_port *p,
35 p->state == BR_STATE_FORWARDING; 35 p->state == BR_STATE_FORWARDING;
36} 36}
37 37
38int br_dev_queue_push_xmit(struct sock *sk, struct sk_buff *skb) 38int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)
39{ 39{
40 if (!is_skb_forwardable(skb->dev, skb)) 40 if (!is_skb_forwardable(skb->dev, skb))
41 goto drop; 41 goto drop;
@@ -65,9 +65,8 @@ drop:
65} 65}
66EXPORT_SYMBOL_GPL(br_dev_queue_push_xmit); 66EXPORT_SYMBOL_GPL(br_dev_queue_push_xmit);
67 67
68int br_forward_finish(struct sock *sk, struct sk_buff *skb) 68int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
69{ 69{
70 struct net *net = dev_net(skb->dev);
71 return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, 70 return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING,
72 net, sk, skb, NULL, skb->dev, 71 net, sk, skb, NULL, skb->dev,
73 br_dev_queue_push_xmit); 72 br_dev_queue_push_xmit);
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 78fa7acd836e..223f4040d9df 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -26,7 +26,8 @@
26br_should_route_hook_t __rcu *br_should_route_hook __read_mostly; 26br_should_route_hook_t __rcu *br_should_route_hook __read_mostly;
27EXPORT_SYMBOL(br_should_route_hook); 27EXPORT_SYMBOL(br_should_route_hook);
28 28
29static int br_netif_receive_skb(struct sock *sk, struct sk_buff *skb) 29static int
30br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb)
30{ 31{
31 return netif_receive_skb(skb); 32 return netif_receive_skb(skb);
32} 33}
@@ -125,7 +126,7 @@ static void br_do_proxy_arp(struct sk_buff *skb, struct net_bridge *br,
125} 126}
126 127
127/* note: already called with rcu_read_lock */ 128/* note: already called with rcu_read_lock */
128int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb) 129int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
129{ 130{
130 const unsigned char *dest = eth_hdr(skb)->h_dest; 131 const unsigned char *dest = eth_hdr(skb)->h_dest;
131 struct net_bridge_port *p = br_port_get_rcu(skb->dev); 132 struct net_bridge_port *p = br_port_get_rcu(skb->dev);
@@ -213,7 +214,7 @@ drop:
213EXPORT_SYMBOL_GPL(br_handle_frame_finish); 214EXPORT_SYMBOL_GPL(br_handle_frame_finish);
214 215
215/* note: already called with rcu_read_lock */ 216/* note: already called with rcu_read_lock */
216static int br_handle_local_finish(struct sock *sk, struct sk_buff *skb) 217static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
217{ 218{
218 struct net_bridge_port *p = br_port_get_rcu(skb->dev); 219 struct net_bridge_port *p = br_port_get_rcu(skb->dev);
219 u16 vid = 0; 220 u16 vid = 0;
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index 7886c9d7e23d..e6e76bbdc82f 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -256,7 +256,7 @@ void nf_bridge_update_protocol(struct sk_buff *skb)
256 * don't, we use the neighbour framework to find out. In both cases, we make 256 * don't, we use the neighbour framework to find out. In both cases, we make
257 * sure that br_handle_frame_finish() is called afterwards. 257 * sure that br_handle_frame_finish() is called afterwards.
258 */ 258 */
259int br_nf_pre_routing_finish_bridge(struct sock *sk, struct sk_buff *skb) 259int br_nf_pre_routing_finish_bridge(struct net *net, struct sock *sk, struct sk_buff *skb)
260{ 260{
261 struct neighbour *neigh; 261 struct neighbour *neigh;
262 struct dst_entry *dst; 262 struct dst_entry *dst;
@@ -273,7 +273,7 @@ int br_nf_pre_routing_finish_bridge(struct sock *sk, struct sk_buff *skb)
273 if (neigh->hh.hh_len) { 273 if (neigh->hh.hh_len) {
274 neigh_hh_bridge(&neigh->hh, skb); 274 neigh_hh_bridge(&neigh->hh, skb);
275 skb->dev = nf_bridge->physindev; 275 skb->dev = nf_bridge->physindev;
276 ret = br_handle_frame_finish(sk, skb); 276 ret = br_handle_frame_finish(net, sk, skb);
277 } else { 277 } else {
278 /* the neighbour function below overwrites the complete 278 /* the neighbour function below overwrites the complete
279 * MAC header, so we save the Ethernet source address and 279 * MAC header, so we save the Ethernet source address and
@@ -342,11 +342,10 @@ br_nf_ipv4_daddr_was_changed(const struct sk_buff *skb,
342 * device, we proceed as if ip_route_input() succeeded. If it differs from the 342 * device, we proceed as if ip_route_input() succeeded. If it differs from the
343 * logical bridge port or if ip_route_output_key() fails we drop the packet. 343 * logical bridge port or if ip_route_output_key() fails we drop the packet.
344 */ 344 */
345static int br_nf_pre_routing_finish(struct sock *sk, struct sk_buff *skb) 345static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
346{ 346{
347 struct net_device *dev = skb->dev; 347 struct net_device *dev = skb->dev;
348 struct iphdr *iph = ip_hdr(skb); 348 struct iphdr *iph = ip_hdr(skb);
349 struct net *net = dev_net(dev);
350 struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb); 349 struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
351 struct rtable *rt; 350 struct rtable *rt;
352 int err; 351 int err;
@@ -536,10 +535,9 @@ static unsigned int br_nf_local_in(const struct nf_hook_ops *ops,
536} 535}
537 536
538/* PF_BRIDGE/FORWARD *************************************************/ 537/* PF_BRIDGE/FORWARD *************************************************/
539static int br_nf_forward_finish(struct sock *sk, struct sk_buff *skb) 538static int br_nf_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
540{ 539{
541 struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb); 540 struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
542 struct net *net = dev_net(skb->dev);
543 struct net_device *in; 541 struct net_device *in;
544 542
545 if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) { 543 if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) {
@@ -692,7 +690,7 @@ static int br_nf_push_frag_xmit(struct net *net, struct sock *sk, struct sk_buff
692 __skb_push(skb, data->encap_size); 690 __skb_push(skb, data->encap_size);
693 691
694 nf_bridge_info_free(skb); 692 nf_bridge_info_free(skb);
695 return br_dev_queue_push_xmit(sk, skb); 693 return br_dev_queue_push_xmit(net, sk, skb);
696} 694}
697static int br_nf_push_frag_xmit_sk(struct sock *sk, struct sk_buff *skb) 695static int br_nf_push_frag_xmit_sk(struct sock *sk, struct sk_buff *skb)
698{ 696{
@@ -728,17 +726,16 @@ static unsigned int nf_bridge_mtu_reduction(const struct sk_buff *skb)
728 return 0; 726 return 0;
729} 727}
730 728
731static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb) 729static int br_nf_dev_queue_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)
732{ 730{
733 struct nf_bridge_info *nf_bridge; 731 struct nf_bridge_info *nf_bridge;
734 unsigned int mtu_reserved; 732 unsigned int mtu_reserved;
735 struct net *net = dev_net(skb_dst(skb)->dev);
736 733
737 mtu_reserved = nf_bridge_mtu_reduction(skb); 734 mtu_reserved = nf_bridge_mtu_reduction(skb);
738 735
739 if (skb_is_gso(skb) || skb->len + mtu_reserved <= skb->dev->mtu) { 736 if (skb_is_gso(skb) || skb->len + mtu_reserved <= skb->dev->mtu) {
740 nf_bridge_info_free(skb); 737 nf_bridge_info_free(skb);
741 return br_dev_queue_push_xmit(sk, skb); 738 return br_dev_queue_push_xmit(net, sk, skb);
742 } 739 }
743 740
744 nf_bridge = nf_bridge_info_get(skb); 741 nf_bridge = nf_bridge_info_get(skb);
@@ -797,7 +794,7 @@ static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb)
797 } 794 }
798#endif 795#endif
799 nf_bridge_info_free(skb); 796 nf_bridge_info_free(skb);
800 return br_dev_queue_push_xmit(sk, skb); 797 return br_dev_queue_push_xmit(net, sk, skb);
801 drop: 798 drop:
802 kfree_skb(skb); 799 kfree_skb(skb);
803 return 0; 800 return 0;
@@ -887,7 +884,7 @@ static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
887 skb->dev = nf_bridge->physindev; 884 skb->dev = nf_bridge->physindev;
888 885
889 nf_bridge->physoutdev = NULL; 886 nf_bridge->physoutdev = NULL;
890 br_handle_frame_finish(NULL, skb); 887 br_handle_frame_finish(dev_net(skb->dev), NULL, skb);
891} 888}
892 889
893static int br_nf_dev_xmit(struct sk_buff *skb) 890static int br_nf_dev_xmit(struct sk_buff *skb)
diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
index 5d19361ad5d3..e4dbbe44c724 100644
--- a/net/bridge/br_netfilter_ipv6.c
+++ b/net/bridge/br_netfilter_ipv6.c
@@ -161,12 +161,11 @@ br_nf_ipv6_daddr_was_changed(const struct sk_buff *skb,
161 * for br_nf_pre_routing_finish(), same logic is used here but 161 * for br_nf_pre_routing_finish(), same logic is used here but
162 * equivalent IPv6 function ip6_route_input() called indirectly. 162 * equivalent IPv6 function ip6_route_input() called indirectly.
163 */ 163 */
164static int br_nf_pre_routing_finish_ipv6(struct sock *sk, struct sk_buff *skb) 164static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struct sk_buff *skb)
165{ 165{
166 struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb); 166 struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
167 struct rtable *rt; 167 struct rtable *rt;
168 struct net_device *dev = skb->dev; 168 struct net_device *dev = skb->dev;
169 struct net *net = dev_net(dev);
170 const struct nf_ipv6_ops *v6ops = nf_get_ipv6_ops(); 169 const struct nf_ipv6_ops *v6ops = nf_get_ipv6_ops();
171 170
172 nf_bridge->frag_max_size = IP6CB(skb)->frag_max_size; 171 nf_bridge->frag_max_size = IP6CB(skb)->frag_max_size;
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 213baf7aaa93..74e99c75c8e4 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -413,10 +413,10 @@ int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p,
413 413
414/* br_forward.c */ 414/* br_forward.c */
415void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb); 415void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb);
416int br_dev_queue_push_xmit(struct sock *sk, struct sk_buff *skb); 416int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb);
417void br_forward(const struct net_bridge_port *to, 417void br_forward(const struct net_bridge_port *to,
418 struct sk_buff *skb, struct sk_buff *skb0); 418 struct sk_buff *skb, struct sk_buff *skb0);
419int br_forward_finish(struct sock *sk, struct sk_buff *skb); 419int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
420void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb, bool unicast); 420void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb, bool unicast);
421void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, 421void br_flood_forward(struct net_bridge *br, struct sk_buff *skb,
422 struct sk_buff *skb2, bool unicast); 422 struct sk_buff *skb2, bool unicast);
@@ -434,7 +434,7 @@ void br_port_flags_change(struct net_bridge_port *port, unsigned long mask);
434void br_manage_promisc(struct net_bridge *br); 434void br_manage_promisc(struct net_bridge *br);
435 435
436/* br_input.c */ 436/* br_input.c */
437int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb); 437int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
438rx_handler_result_t br_handle_frame(struct sk_buff **pskb); 438rx_handler_result_t br_handle_frame(struct sk_buff **pskb);
439 439
440static inline bool br_rx_handler_check_rcu(const struct net_device *dev) 440static inline bool br_rx_handler_check_rcu(const struct net_device *dev)
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
index 8e2e8c352198..5881fbc114a9 100644
--- a/net/bridge/br_stp_bpdu.c
+++ b/net/bridge/br_stp_bpdu.c
@@ -30,7 +30,8 @@
30 30
31#define LLC_RESERVE sizeof(struct llc_pdu_un) 31#define LLC_RESERVE sizeof(struct llc_pdu_un)
32 32
33static int br_send_bpdu_finish(struct sock *sk, struct sk_buff *skb) 33static int br_send_bpdu_finish(struct net *net, struct sock *sk,
34 struct sk_buff *skb)
34{ 35{
35 return dev_queue_xmit(skb); 36 return dev_queue_xmit(skb);
36} 37}
diff --git a/net/core/dev.c b/net/core/dev.c
index 7db9b012dfb7..00dccfac8939 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2915,9 +2915,11 @@ EXPORT_SYMBOL(xmit_recursion);
2915 2915
2916/** 2916/**
2917 * dev_loopback_xmit - loop back @skb 2917 * dev_loopback_xmit - loop back @skb
2918 * @net: network namespace this loopback is happening in
2919 * @sk: sk needed to be a netfilter okfn
2918 * @skb: buffer to transmit 2920 * @skb: buffer to transmit
2919 */ 2921 */
2920int dev_loopback_xmit(struct sock *sk, struct sk_buff *skb) 2922int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)
2921{ 2923{
2922 skb_reset_mac_header(skb); 2924 skb_reset_mac_header(skb);
2923 __skb_pull(skb, skb_network_offset(skb)); 2925 __skb_pull(skb, skb_network_offset(skb));
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 305ab2fe25cd..482730cd8a56 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -194,7 +194,7 @@ static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb)
194 return err; 194 return err;
195} 195}
196 196
197static int dn_neigh_output_packet(struct sock *sk, struct sk_buff *skb) 197static int dn_neigh_output_packet(struct net *net, struct sock *sk, struct sk_buff *skb)
198{ 198{
199 struct dst_entry *dst = skb_dst(skb); 199 struct dst_entry *dst = skb_dst(skb);
200 struct dn_route *rt = (struct dn_route *)dst; 200 struct dn_route *rt = (struct dn_route *)dst;
@@ -334,7 +334,7 @@ static int dn_phase3_output(struct neighbour *neigh, struct sock *sk,
334 dn_neigh_output_packet); 334 dn_neigh_output_packet);
335} 335}
336 336
337int dn_to_neigh_output(struct sock *sk, struct sk_buff *skb) 337int dn_to_neigh_output(struct net *net, struct sock *sk, struct sk_buff *skb)
338{ 338{
339 struct dst_entry *dst = skb_dst(skb); 339 struct dst_entry *dst = skb_dst(skb);
340 struct dn_route *rt = (struct dn_route *) dst; 340 struct dn_route *rt = (struct dn_route *) dst;
@@ -378,7 +378,7 @@ void dn_neigh_pointopoint_hello(struct sk_buff *skb)
378/* 378/*
379 * Ethernet router hello message received 379 * Ethernet router hello message received
380 */ 380 */
381int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb) 381int dn_neigh_router_hello(struct net *net, struct sock *sk, struct sk_buff *skb)
382{ 382{
383 struct rtnode_hello_message *msg = (struct rtnode_hello_message *)skb->data; 383 struct rtnode_hello_message *msg = (struct rtnode_hello_message *)skb->data;
384 384
@@ -440,7 +440,7 @@ int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb)
440/* 440/*
441 * Endnode hello message received 441 * Endnode hello message received
442 */ 442 */
443int dn_neigh_endnode_hello(struct sock *sk, struct sk_buff *skb) 443int dn_neigh_endnode_hello(struct net *net, struct sock *sk, struct sk_buff *skb)
444{ 444{
445 struct endnode_hello_message *msg = (struct endnode_hello_message *)skb->data; 445 struct endnode_hello_message *msg = (struct endnode_hello_message *)skb->data;
446 struct neighbour *neigh; 446 struct neighbour *neigh;
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index e7b0605ca34a..7ac086d5c0c0 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -714,7 +714,8 @@ out:
714 return ret; 714 return ret;
715} 715}
716 716
717static int dn_nsp_rx_packet(struct sock *sk2, struct sk_buff *skb) 717static int dn_nsp_rx_packet(struct net *net, struct sock *sk2,
718 struct sk_buff *skb)
718{ 719{
719 struct dn_skb_cb *cb = DN_SKB_CB(skb); 720 struct dn_skb_cb *cb = DN_SKB_CB(skb);
720 struct sock *sk = NULL; 721 struct sock *sk = NULL;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index fefcd2e85ef9..e930321e2c1d 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -512,7 +512,7 @@ static int dn_return_long(struct sk_buff *skb)
512 * 512 *
513 * Returns: result of input function if route is found, error code otherwise 513 * Returns: result of input function if route is found, error code otherwise
514 */ 514 */
515static int dn_route_rx_packet(struct sock *sk, struct sk_buff *skb) 515static int dn_route_rx_packet(struct net *net, struct sock *sk, struct sk_buff *skb)
516{ 516{
517 struct dn_skb_cb *cb; 517 struct dn_skb_cb *cb;
518 int err; 518 int err;
@@ -610,7 +610,7 @@ drop_it:
610 return NET_RX_DROP; 610 return NET_RX_DROP;
611} 611}
612 612
613static int dn_route_discard(struct sock *sk, struct sk_buff *skb) 613static int dn_route_discard(struct net *net, struct sock *sk, struct sk_buff *skb)
614{ 614{
615 /* 615 /*
616 * I know we drop the packet here, but thats considered success in 616 * I know we drop the packet here, but thats considered success in
@@ -620,7 +620,7 @@ static int dn_route_discard(struct sock *sk, struct sk_buff *skb)
620 return NET_RX_SUCCESS; 620 return NET_RX_SUCCESS;
621} 621}
622 622
623static int dn_route_ptp_hello(struct sock *sk, struct sk_buff *skb) 623static int dn_route_ptp_hello(struct net *net, struct sock *sk, struct sk_buff *skb)
624{ 624{
625 dn_dev_hello(skb); 625 dn_dev_hello(skb);
626 dn_neigh_pointopoint_hello(skb); 626 dn_neigh_pointopoint_hello(skb);
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index ae71e9ade5f9..61ff5ea31283 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -621,7 +621,7 @@ out:
621} 621}
622EXPORT_SYMBOL(arp_create); 622EXPORT_SYMBOL(arp_create);
623 623
624static int arp_xmit_finish(struct sock *sk, struct sk_buff *skb) 624static int arp_xmit_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
625{ 625{
626 return dev_queue_xmit(skb); 626 return dev_queue_xmit(skb);
627} 627}
@@ -642,7 +642,7 @@ EXPORT_SYMBOL(arp_xmit);
642 * Process an arp request. 642 * Process an arp request.
643 */ 643 */
644 644
645static int arp_process(struct sock *sk, struct sk_buff *skb) 645static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb)
646{ 646{
647 struct net_device *dev = skb->dev; 647 struct net_device *dev = skb->dev;
648 struct in_device *in_dev = __in_dev_get_rcu(dev); 648 struct in_device *in_dev = __in_dev_get_rcu(dev);
@@ -654,7 +654,6 @@ static int arp_process(struct sock *sk, struct sk_buff *skb)
654 u16 dev_type = dev->type; 654 u16 dev_type = dev->type;
655 int addr_type; 655 int addr_type;
656 struct neighbour *n; 656 struct neighbour *n;
657 struct net *net = dev_net(dev);
658 bool is_garp = false; 657 bool is_garp = false;
659 658
660 /* arp_rcv below verifies the ARP header and verifies the device 659 /* arp_rcv below verifies the ARP header and verifies the device
@@ -865,7 +864,7 @@ out:
865 864
866static void parp_redo(struct sk_buff *skb) 865static void parp_redo(struct sk_buff *skb)
867{ 866{
868 arp_process(NULL, skb); 867 arp_process(dev_net(skb->dev), NULL, skb);
869} 868}
870 869
871 870
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index 0a3c45a2e757..d66cfb35ba74 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -61,9 +61,8 @@ static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
61} 61}
62 62
63 63
64static int ip_forward_finish(struct sock *sk, struct sk_buff *skb) 64static int ip_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
65{ 65{
66 struct net *net = dev_net(skb_dst(skb)->dev);
67 struct ip_options *opt = &(IPCB(skb)->opt); 66 struct ip_options *opt = &(IPCB(skb)->opt);
68 67
69 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTFORWDATAGRAMS); 68 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTFORWDATAGRAMS);
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 991d082c7312..7cc9f7bb7fb7 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -188,10 +188,8 @@ bool ip_call_ra_chain(struct sk_buff *skb)
188 return false; 188 return false;
189} 189}
190 190
191static int ip_local_deliver_finish(struct sock *sk, struct sk_buff *skb) 191static int ip_local_deliver_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
192{ 192{
193 struct net *net = dev_net(skb->dev);
194
195 __skb_pull(skb, skb_network_header_len(skb)); 193 __skb_pull(skb, skb_network_header_len(skb));
196 194
197 rcu_read_lock(); 195 rcu_read_lock();
@@ -311,10 +309,9 @@ drop:
311int sysctl_ip_early_demux __read_mostly = 1; 309int sysctl_ip_early_demux __read_mostly = 1;
312EXPORT_SYMBOL(sysctl_ip_early_demux); 310EXPORT_SYMBOL(sysctl_ip_early_demux);
313 311
314static int ip_rcv_finish(struct sock *sk, struct sk_buff *skb) 312static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
315{ 313{
316 const struct iphdr *iph = ip_hdr(skb); 314 const struct iphdr *iph = ip_hdr(skb);
317 struct net *net = dev_net(skb->dev);
318 struct rtable *rt; 315 struct rtable *rt;
319 316
320 if (sysctl_ip_early_demux && !skb_dst(skb) && !skb->sk) { 317 if (sysctl_ip_early_demux && !skb_dst(skb) && !skb->sk) {
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 4c9532259a7f..09a6b7bb7ea3 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -104,7 +104,7 @@ static int __ip_local_out_sk(struct sock *sk, struct sk_buff *skb)
104 ip_send_check(iph); 104 ip_send_check(iph);
105 return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT, 105 return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT,
106 net, sk, skb, NULL, skb_dst(skb)->dev, 106 net, sk, skb, NULL, skb_dst(skb)->dev,
107 dst_output); 107 dst_output_okfn);
108} 108}
109 109
110int __ip_local_out(struct sk_buff *skb) 110int __ip_local_out(struct sk_buff *skb)
@@ -266,7 +266,7 @@ static int ip_finish_output_gso(struct sock *sk, struct sk_buff *skb,
266 return ret; 266 return ret;
267} 267}
268 268
269static int ip_finish_output(struct sock *sk, struct sk_buff *skb) 269static int ip_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb)
270{ 270{
271 unsigned int mtu; 271 unsigned int mtu;
272 272
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index a88c0c5374ff..cfcb996ec51b 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1678,10 +1678,10 @@ static void ip_encap(struct net *net, struct sk_buff *skb,
1678 nf_reset(skb); 1678 nf_reset(skb);
1679} 1679}
1680 1680
1681static inline int ipmr_forward_finish(struct sock *sk, struct sk_buff *skb) 1681static inline int ipmr_forward_finish(struct net *net, struct sock *sk,
1682 struct sk_buff *skb)
1682{ 1683{
1683 struct ip_options *opt = &(IPCB(skb)->opt); 1684 struct ip_options *opt = &(IPCB(skb)->opt);
1684 struct net *net = dev_net(skb_dst(skb)->dev);
1685 1685
1686 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTFORWDATAGRAMS); 1686 IP_INC_STATS_BH(net, IPSTATS_MIB_OUTFORWDATAGRAMS);
1687 IP_ADD_STATS_BH(net, IPSTATS_MIB_OUTOCTETS, skb->len); 1687 IP_ADD_STATS_BH(net, IPSTATS_MIB_OUTOCTETS, skb->len);
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 2045b1aaa6ef..28ef8a913130 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -413,7 +413,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
413 413
414 err = NF_HOOK(NFPROTO_IPV4, NF_INET_LOCAL_OUT, 414 err = NF_HOOK(NFPROTO_IPV4, NF_INET_LOCAL_OUT,
415 net, sk, skb, NULL, rt->dst.dev, 415 net, sk, skb, NULL, rt->dst.dev,
416 dst_output); 416 dst_output_okfn);
417 if (err > 0) 417 if (err > 0)
418 err = net_xmit_errno(err); 418 err = net_xmit_errno(err);
419 if (err) 419 if (err)
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c
index 5093000d3d5e..62e1e72db461 100644
--- a/net/ipv4/xfrm4_input.c
+++ b/net/ipv4/xfrm4_input.c
@@ -22,7 +22,8 @@ int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb)
22 return xfrm4_extract_header(skb); 22 return xfrm4_extract_header(skb);
23} 23}
24 24
25static inline int xfrm4_rcv_encap_finish(struct sock *sk, struct sk_buff *skb) 25static inline int xfrm4_rcv_encap_finish(struct net *net, struct sock *sk,
26 struct sk_buff *skb)
26{ 27{
27 if (!skb_dst(skb)) { 28 if (!skb_dst(skb)) {
28 const struct iphdr *iph = ip_hdr(skb); 29 const struct iphdr *iph = ip_hdr(skb);
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index e4a85199e015..28ae2048b93a 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -80,7 +80,7 @@ int xfrm4_output_finish(struct sock *sk, struct sk_buff *skb)
80 return xfrm_output(sk, skb); 80 return xfrm_output(sk, skb);
81} 81}
82 82
83static int __xfrm4_output(struct sock *sk, struct sk_buff *skb) 83static int __xfrm4_output(struct net *net, struct sock *sk, struct sk_buff *skb)
84{ 84{
85 struct xfrm_state *x = skb_dst(skb)->xfrm; 85 struct xfrm_state *x = skb_dst(skb)->xfrm;
86 86
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 583cf959c23d..9075acf081dd 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -47,7 +47,7 @@
47#include <net/inet_ecn.h> 47#include <net/inet_ecn.h>
48#include <net/dst_metadata.h> 48#include <net/dst_metadata.h>
49 49
50int ip6_rcv_finish(struct sock *sk, struct sk_buff *skb) 50int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
51{ 51{
52 if (sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) { 52 if (sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) {
53 const struct inet6_protocol *ipprot; 53 const struct inet6_protocol *ipprot;
@@ -199,9 +199,8 @@ drop:
199 */ 199 */
200 200
201 201
202static int ip6_input_finish(struct sock *sk, struct sk_buff *skb) 202static int ip6_input_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
203{ 203{
204 struct net *net = dev_net(skb_dst(skb)->dev);
205 const struct inet6_protocol *ipprot; 204 const struct inet6_protocol *ipprot;
206 struct inet6_dev *idev; 205 struct inet6_dev *idev;
207 unsigned int nhoff; 206 unsigned int nhoff;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 96e76ddd4a44..d8d68e81d123 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -121,7 +121,7 @@ static int ip6_finish_output2(struct sock *sk, struct sk_buff *skb)
121 return -EINVAL; 121 return -EINVAL;
122} 122}
123 123
124static int ip6_finish_output(struct sock *sk, struct sk_buff *skb) 124static int ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb)
125{ 125{
126 if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) || 126 if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
127 dst_allfrag(skb_dst(skb)) || 127 dst_allfrag(skb_dst(skb)) ||
@@ -225,7 +225,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
225 IPSTATS_MIB_OUT, skb->len); 225 IPSTATS_MIB_OUT, skb->len);
226 return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, 226 return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
227 net, sk, skb, NULL, dst->dev, 227 net, sk, skb, NULL, dst->dev,
228 dst_output); 228 dst_output_okfn);
229 } 229 }
230 230
231 skb->dev = dst->dev; 231 skb->dev = dst->dev;
@@ -317,7 +317,8 @@ static int ip6_forward_proxy_check(struct sk_buff *skb)
317 return 0; 317 return 0;
318} 318}
319 319
320static inline int ip6_forward_finish(struct sock *sk, struct sk_buff *skb) 320static inline int ip6_forward_finish(struct net *net, struct sock *sk,
321 struct sk_buff *skb)
321{ 322{
322 skb_sender_cpu_clear(skb); 323 skb_sender_cpu_clear(skb);
323 return dst_output(sk, skb); 324 return dst_output(sk, skb);
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index e830942b2090..5e5d16e7ce85 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1985,9 +1985,8 @@ int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
1985} 1985}
1986#endif 1986#endif
1987 1987
1988static inline int ip6mr_forward2_finish(struct sock *sk, struct sk_buff *skb) 1988static inline int ip6mr_forward2_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
1989{ 1989{
1990 struct net *net = dev_net(skb_dst(skb)->dev);
1991 IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), 1990 IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
1992 IPSTATS_MIB_OUTFORWDATAGRAMS); 1991 IPSTATS_MIB_OUTFORWDATAGRAMS);
1993 IP6_ADD_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), 1992 IP6_ADD_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 124338a39e29..a8bf57ca74d3 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1646,7 +1646,7 @@ static void mld_sendpack(struct sk_buff *skb)
1646 1646
1647 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, 1647 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
1648 net, net->ipv6.igmp_sk, skb, NULL, skb->dev, 1648 net, net->ipv6.igmp_sk, skb, NULL, skb->dev,
1649 dst_output); 1649 dst_output_okfn);
1650out: 1650out:
1651 if (!err) { 1651 if (!err) {
1652 ICMP6MSGOUT_INC_STATS(net, idev, ICMPV6_MLD2_REPORT); 1652 ICMP6MSGOUT_INC_STATS(net, idev, ICMPV6_MLD2_REPORT);
@@ -2010,7 +2010,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
2010 skb_dst_set(skb, dst); 2010 skb_dst_set(skb, dst);
2011 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, 2011 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
2012 net, sk, skb, NULL, skb->dev, 2012 net, sk, skb, NULL, skb->dev,
2013 dst_output); 2013 dst_output_okfn);
2014out: 2014out:
2015 if (!err) { 2015 if (!err) {
2016 ICMP6MSGOUT_INC_STATS(net, idev, type); 2016 ICMP6MSGOUT_INC_STATS(net, idev, type);
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index dd2b08d7c8d1..dde5a1e5875a 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -465,7 +465,7 @@ static void ndisc_send_skb(struct sk_buff *skb,
465 465
466 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, 466 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
467 net, sk, skb, NULL, dst->dev, 467 net, sk, skb, NULL, dst->dev,
468 dst_output); 468 dst_output_okfn);
469 if (!err) { 469 if (!err) {
470 ICMP6MSGOUT_INC_STATS(net, idev, type); 470 ICMP6MSGOUT_INC_STATS(net, idev, type);
471 ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTMSGS); 471 ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTMSGS);
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 9cc9127fb5e7..e77102c4f804 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -151,7 +151,7 @@ static int __ip6_local_out_sk(struct sock *sk, struct sk_buff *skb)
151 151
152 return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT, 152 return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
153 net, sk, skb, NULL, skb_dst(skb)->dev, 153 net, sk, skb, NULL, skb_dst(skb)->dev,
154 dst_output); 154 dst_output_okfn);
155} 155}
156 156
157int __ip6_local_out(struct sk_buff *skb) 157int __ip6_local_out(struct sk_buff *skb)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index dc65ec198f7c..fec0151522a2 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -655,7 +655,7 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
655 655
656 IP6_UPD_PO_STATS(net, rt->rt6i_idev, IPSTATS_MIB_OUT, skb->len); 656 IP6_UPD_PO_STATS(net, rt->rt6i_idev, IPSTATS_MIB_OUT, skb->len);
657 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, net, sk, skb, 657 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, net, sk, skb,
658 NULL, rt->dst.dev, dst_output); 658 NULL, rt->dst.dev, dst_output_okfn);
659 if (err > 0) 659 if (err > 0)
660 err = net_xmit_errno(err); 660 err = net_xmit_errno(err);
661 if (err) 661 if (err)
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index 431ae2c22234..68a996f8a044 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -131,7 +131,7 @@ int xfrm6_output_finish(struct sock *sk, struct sk_buff *skb)
131 return xfrm_output(sk, skb); 131 return xfrm_output(sk, skb);
132} 132}
133 133
134static int __xfrm6_output(struct sock *sk, struct sk_buff *skb) 134static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
135{ 135{
136 struct dst_entry *dst = skb_dst(skb); 136 struct dst_entry *dst = skb_dst(skb);
137 struct xfrm_state *x = dst->xfrm; 137 struct xfrm_state *x = dst->xfrm;
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 65c996c14bca..cc7299033af8 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -574,7 +574,7 @@ static inline int ip_vs_nat_send_or_cont(int pf, struct sk_buff *skb,
574 if (!skb->sk) 574 if (!skb->sk)
575 skb_sender_cpu_clear(skb); 575 skb_sender_cpu_clear(skb);
576 NF_HOOK(pf, NF_INET_LOCAL_OUT, ip_vs_conn_net(cp), NULL, skb, 576 NF_HOOK(pf, NF_INET_LOCAL_OUT, ip_vs_conn_net(cp), NULL, skb,
577 NULL, skb_dst(skb)->dev, dst_output); 577 NULL, skb_dst(skb)->dev, dst_output_okfn);
578 } else 578 } else
579 ret = NF_ACCEPT; 579 ret = NF_ACCEPT;
580 580
@@ -596,7 +596,7 @@ static inline int ip_vs_send_or_cont(int pf, struct sk_buff *skb,
596 if (!skb->sk) 596 if (!skb->sk)
597 skb_sender_cpu_clear(skb); 597 skb_sender_cpu_clear(skb);
598 NF_HOOK(pf, NF_INET_LOCAL_OUT, ip_vs_conn_net(cp), NULL, skb, 598 NF_HOOK(pf, NF_INET_LOCAL_OUT, ip_vs_conn_net(cp), NULL, skb,
599 NULL, skb_dst(skb)->dev, dst_output); 599 NULL, skb_dst(skb)->dev, dst_output_okfn);
600 } else 600 } else
601 ret = NF_ACCEPT; 601 ret = NF_ACCEPT;
602 return ret; 602 return ret;
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index 96777f9a9350..9f3c3c25fa73 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -215,7 +215,7 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
215 case NF_ACCEPT: 215 case NF_ACCEPT:
216 case NF_STOP: 216 case NF_STOP:
217 local_bh_disable(); 217 local_bh_disable();
218 entry->state.okfn(entry->state.sk, skb); 218 entry->state.okfn(entry->state.net, entry->state.sk, skb);
219 local_bh_enable(); 219 local_bh_enable();
220 break; 220 break;
221 case NF_QUEUE: 221 case NF_QUEUE:
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index c21f1a02ce13..61ba99f61dc8 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -19,7 +19,7 @@
19#include <net/dst.h> 19#include <net/dst.h>
20#include <net/xfrm.h> 20#include <net/xfrm.h>
21 21
22static int xfrm_output2(struct sock *sk, struct sk_buff *skb); 22static int xfrm_output2(struct net *net, struct sock *sk, struct sk_buff *skb);
23 23
24static int xfrm_skb_check_space(struct sk_buff *skb) 24static int xfrm_skb_check_space(struct sk_buff *skb)
25{ 25{
@@ -157,12 +157,12 @@ out:
157} 157}
158EXPORT_SYMBOL_GPL(xfrm_output_resume); 158EXPORT_SYMBOL_GPL(xfrm_output_resume);
159 159
160static int xfrm_output2(struct sock *sk, struct sk_buff *skb) 160static int xfrm_output2(struct net *net, struct sock *sk, struct sk_buff *skb)
161{ 161{
162 return xfrm_output_resume(skb, 1); 162 return xfrm_output_resume(skb, 1);
163} 163}
164 164
165static int xfrm_output_gso(struct sock *sk, struct sk_buff *skb) 165static int xfrm_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb)
166{ 166{
167 struct sk_buff *segs; 167 struct sk_buff *segs;
168 168
@@ -178,7 +178,7 @@ static int xfrm_output_gso(struct sock *sk, struct sk_buff *skb)
178 int err; 178 int err;
179 179
180 segs->next = NULL; 180 segs->next = NULL;
181 err = xfrm_output2(sk, segs); 181 err = xfrm_output2(net, sk, segs);
182 182
183 if (unlikely(err)) { 183 if (unlikely(err)) {
184 kfree_skb_list(nskb); 184 kfree_skb_list(nskb);
@@ -197,7 +197,7 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
197 int err; 197 int err;
198 198
199 if (skb_is_gso(skb)) 199 if (skb_is_gso(skb))
200 return xfrm_output_gso(sk, skb); 200 return xfrm_output_gso(net, sk, skb);
201 201
202 if (skb->ip_summed == CHECKSUM_PARTIAL) { 202 if (skb->ip_summed == CHECKSUM_PARTIAL) {
203 err = skb_checksum_help(skb); 203 err = skb_checksum_help(skb);
@@ -208,7 +208,7 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
208 } 208 }
209 } 209 }
210 210
211 return xfrm_output2(sk, skb); 211 return xfrm_output2(net, sk, skb);
212} 212}
213EXPORT_SYMBOL_GPL(xfrm_output); 213EXPORT_SYMBOL_GPL(xfrm_output);
214 214