]> git.ipfire.org Git - people/arne_f/kernel.git/commit - net/netfilter/nf_conntrack_core.c
netfilter: nf_conntrack: permanently attach timeout policy to conntrack
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 22 Mar 2012 23:04:53 +0000 (00:04 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 22 Mar 2012 23:52:08 +0000 (00:52 +0100)
commit60b5f8f745739a4789395648595ed31ede582448
tree9b818ddc4cea729301110bbbc082c010f30dd691
parenteeb4cb952386aac764a5cf4cf2490e50a24a8880
netfilter: nf_conntrack: permanently attach timeout policy to conntrack

We need to permanently attach the timeout policy to the conntrack,
otherwise we may apply the custom timeout policy inconsistently.

Without this patch, the following example:

 nfct timeout add test inet icmp timeout 100
 iptables -I PREROUTING -t raw -p icmp -s 1.1.1.1 -j CT --timeout test

Will only apply the custom timeout policy to outgoing packets from
1.1.1.1, but not to reply packets from 2.2.2.2 going to 1.1.1.1.

To fix this issue, this patch modifies the current logic to attach the
timeout policy when the first packet is seen (which is when the
conntrack entry is created). Then, we keep using the attached timeout
policy until the conntrack entry is destroyed.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_core.c