]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_flow_offload: Fix reverse route lookup
authorwenxu <wenxu@ucloud.cn>
Wed, 9 Jan 2019 02:40:11 +0000 (10:40 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Jan 2019 22:25:02 +0000 (23:25 +0100)
commit4e2008eef363894af4dc3e881fda0c9a2d1ecb40
tree319c58a8050cf2421ef6b479df194b6705745004
parent6b32b8ebba659a907edf99780c6656df080a6244
netfilter: nft_flow_offload: Fix reverse route lookup

Using the following example:

client 1.1.1.7 ---> 2.2.2.7 which dnat to 10.0.0.7 server

The first reply packet (ie. syn+ack) uses an incorrect destination
address for the reverse route lookup since it uses:

daddr = ct->tuplehash[!dir].tuple.dst.u3.ip;

which is 2.2.2.7 in the scenario that is described above, while this
should be:

daddr = ct->tuplehash[dir].tuple.src.u3.ip;

that is 10.0.0.7.

Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_flow_offload.c