mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
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>
This commit is contained in:
parent
9dff2c966a
commit
0c4b51f005
37 changed files with 95 additions and 94 deletions
|
@ -19,7 +19,7 @@
|
|||
#include <net/dst.h>
|
||||
#include <net/xfrm.h>
|
||||
|
||||
static int xfrm_output2(struct sock *sk, struct sk_buff *skb);
|
||||
static int xfrm_output2(struct net *net, struct sock *sk, struct sk_buff *skb);
|
||||
|
||||
static int xfrm_skb_check_space(struct sk_buff *skb)
|
||||
{
|
||||
|
@ -157,12 +157,12 @@ out:
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(xfrm_output_resume);
|
||||
|
||||
static int xfrm_output2(struct sock *sk, struct sk_buff *skb)
|
||||
static int xfrm_output2(struct net *net, struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
return xfrm_output_resume(skb, 1);
|
||||
}
|
||||
|
||||
static int xfrm_output_gso(struct sock *sk, struct sk_buff *skb)
|
||||
static int xfrm_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
struct sk_buff *segs;
|
||||
|
||||
|
@ -178,7 +178,7 @@ static int xfrm_output_gso(struct sock *sk, struct sk_buff *skb)
|
|||
int err;
|
||||
|
||||
segs->next = NULL;
|
||||
err = xfrm_output2(sk, segs);
|
||||
err = xfrm_output2(net, sk, segs);
|
||||
|
||||
if (unlikely(err)) {
|
||||
kfree_skb_list(nskb);
|
||||
|
@ -197,7 +197,7 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
|
|||
int err;
|
||||
|
||||
if (skb_is_gso(skb))
|
||||
return xfrm_output_gso(sk, skb);
|
||||
return xfrm_output_gso(net, sk, skb);
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
err = skb_checksum_help(skb);
|
||||
|
@ -208,7 +208,7 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
|
|||
}
|
||||
}
|
||||
|
||||
return xfrm_output2(sk, skb);
|
||||
return xfrm_output2(net, sk, skb);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xfrm_output);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue