aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-09-15 21:04:18 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-17 20:18:37 -0400
commit0c4b51f0054ce85c0ec578ab818f0631834573eb (patch)
tree73e729f58fbaf6420e0f390e36aa936ddaa219ef /net/ipv6/ip6_output.c
parent9dff2c966a0a79a4222553a851f17e679fc28a43 (diff)
netfilter: Pass net into okfn
This is immediately motivated by the bridge code that chains functions that call into netfilter. Without passing net into the okfns the bridge code would need to guess about the best expression for the network namespace to process packets in. As net is frequently one of the first things computed in continuation functions after netfilter has done it's job passing in the desired network namespace is in many cases a code simplification. To support this change the function dst_output_okfn is introduced to simplify passing dst_output as an okfn. For the moment dst_output_okfn just silently drops the struct net. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c7
1 files changed, 4 insertions, 3 deletions
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);