summaryrefslogtreecommitdiffstats
path: root/net/xfrm
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/xfrm
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/xfrm')
-rw-r--r--net/xfrm/xfrm_output.c12
1 files changed, 6 insertions, 6 deletions
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