]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
netfilter: reset netfilter state when duplicating packet
authorFlorian Westphal <fw@strlen.de>
Mon, 23 Jan 2017 17:21:54 +0000 (18:21 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 2 Feb 2017 13:31:51 +0000 (14:31 +0100)
We should also toss nf_bridge_info, if any -- packet is leaving via
ip_local_out, also, this skb isn't bridged -- it is a locally generated
copy.  Also this avoids the need to touch this later when skb->nfct is
replaced with 'unsigned long _nfct' in followup patch.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_dup_ipv4.c
net/ipv6/netfilter/nf_dup_ipv6.c

index cf986e1c7bbd2e2383ba37cf54fae87fccfdc72c..a981ef7151caadc150896eafcca129f2a1ca532e 100644 (file)
@@ -68,7 +68,7 @@ void nf_dup_ipv4(struct net *net, struct sk_buff *skb, unsigned int hooknum,
 
 #if IS_ENABLED(CONFIG_NF_CONNTRACK)
        /* Avoid counting cloned packets towards the original connection. */
-       nf_conntrack_put(skb->nfct);
+       nf_reset(skb);
        skb->nfct     = &nf_ct_untracked_get()->ct_general;
        skb->nfctinfo = IP_CT_NEW;
        nf_conntrack_get(skb->nfct);
index 4a84b5ad9ecbb74b29ef509d00fbda60868833cd..5f52e5f90e7e01c2e181a094ee7b517e7ca10f34 100644 (file)
@@ -57,7 +57,7 @@ void nf_dup_ipv6(struct net *net, struct sk_buff *skb, unsigned int hooknum,
                return;
 
 #if IS_ENABLED(CONFIG_NF_CONNTRACK)
-       nf_conntrack_put(skb->nfct);
+       nf_reset(skb);
        skb->nfct     = &nf_ct_untracked_get()->ct_general;
        skb->nfctinfo = IP_CT_NEW;
        nf_conntrack_get(skb->nfct);