]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_nat: avoid double seq_adjust for loopback
authorJulian Anastasov <ja@ssi.bg>
Thu, 16 Jun 2011 15:29:22 +0000 (17:29 +0200)
committerPatrick McHardy <kaber@trash.net>
Thu, 16 Jun 2011 15:29:22 +0000 (17:29 +0200)
commitcddf7308cf16e910d745635ac1d3436ed2d6d84e
tree5b05b0324b8186fe8bc40ffced48c856b099547d
parentcc910408afa75f9f3c546196bb2abfeab8a277bc
netfilter: nf_nat: avoid double seq_adjust for loopback

Avoid double seq adjustment for loopback traffic
because it causes silent repetition of TCP data. One
example is passive FTP with DNAT rule and difference in the
length of IP addresses.

This patch adds check if packet is sent and
received via loopback device. As the same conntrack is
used both for outgoing and incoming direction, we restrict
seq adjustment to happen only in POSTROUTING.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Patrick McHardy <kaber@trash.net>
include/net/netfilter/nf_conntrack.h
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c