]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitfb7c7f65933fa731ff9509e06d8b93259f89f7ba
tree9b818ddc4cea729301110bbbc082c010f30dd691
parent25bd54f335d0728084d5ce32cd92a0dabd4d6228
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