]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_conntrack: set conntrack templates again if we return NF_REPEAT
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Feb 2011 07:08:20 +0000 (08:08 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 9 Feb 2011 07:08:20 +0000 (08:08 +0100)
commitfb18ef1f72f5ae0f467b7b756de159c4a2d3c104
treebb862f2da8a291f6f46b0fb70f329529b1095586
parent7e93eae743b5d5b19c09933684accada2a27537c
netfilter: nf_conntrack: set conntrack templates again if we return NF_REPEAT

The TCP tracking code has a special case that allows to return
NF_REPEAT if we receive a new SYN packet while in TIME_WAIT state.

In this situation, the TCP tracking code destroys the existing
conntrack to start a new clean session.

[DESTROY] tcp      6 src=192.168.0.2 dst=192.168.1.2 sport=38925 dport=8000 src=192.168.1.2 dst=192.168.1.100 sport=8000 dport=38925 [ASSURED]
    [NEW] tcp      6 120 SYN_SENT src=192.168.0.2 dst=192.168.1.2 sport=38925 dport=8000 [UNREPLIED] src=192.168.1.2 dst=192.168.1.100 sport=8000 dport=38925

However, this is a problem for the iptables' CT target event filtering
which will not work in this case since the conntrack template will not
be there for the new session. To fix this, we reassign the conntrack
template to the packet if we return NF_REPEAT.

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