diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-10-09 13:44:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-12 19:44:16 -0700 |
commit | 19bcf9f203c82c2028f5a0881b1f0690e3207190 (patch) | |
tree | a3d9cbc354d0c464f8485b298f25bab4bae7a73b /net/ipv4/netfilter/nf_defrag_ipv4.c | |
parent | 37fcbab61b8ecf75cb5fd81e5809b71c270f9632 (diff) | |
download | op-kernel-dev-19bcf9f203c82c2028f5a0881b1f0690e3207190.zip op-kernel-dev-19bcf9f203c82c2028f5a0881b1f0690e3207190.tar.gz |
ipv4: Pass struct net into ip_defrag and ip_check_defrag
The function ip_defrag is called on both the input and the output
paths of the networking stack. In particular conntrack when it is
tracking outbound packets from the local machine calls ip_defrag.
So add a struct net parameter and stop making ip_defrag guess which
network namespace it needs to defragment packets in.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/netfilter/nf_defrag_ipv4.c')
-rw-r--r-- | net/ipv4/netfilter/nf_defrag_ipv4.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c index b246346..bf25f45 100644 --- a/net/ipv4/netfilter/nf_defrag_ipv4.c +++ b/net/ipv4/netfilter/nf_defrag_ipv4.c @@ -22,14 +22,15 @@ #endif #include <net/netfilter/nf_conntrack_zones.h> -static int nf_ct_ipv4_gather_frags(struct sk_buff *skb, u_int32_t user) +static int nf_ct_ipv4_gather_frags(struct net *net, struct sk_buff *skb, + u_int32_t user) { int err; skb_orphan(skb); local_bh_disable(); - err = ip_defrag(skb, user); + err = ip_defrag(net, skb, user); local_bh_enable(); if (!err) { @@ -85,7 +86,7 @@ static unsigned int ipv4_conntrack_defrag(void *priv, enum ip_defrag_users user = nf_ct_defrag_user(state->hook, skb); - if (nf_ct_ipv4_gather_frags(skb, user)) + if (nf_ct_ipv4_gather_frags(state->net, skb, user)) return NF_STOLEN; } return NF_ACCEPT; |