]> 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)
commit91cec1d66d0b314ffa2e7c2bfeffefb5dbc98dae
tree9b818ddc4cea729301110bbbc082c010f30dd691
parente9c722446addbb9135e60ccf7a65301169a156ef
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