net/sched: act_ct: handle DNAT tuple collision
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Wed, 9 Jun 2021 14:23:56 +0000 (11:23 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Jun 2021 12:42:42 +0000 (14:42 +0200)
commit4733b73709a255a9af90582867f014887482445f
tree65532734cb55e139523f0542fa4a2f920cb6b6a4
parentc8f1437c0145e2750fb9543c552ccc5a47636491
net/sched: act_ct: handle DNAT tuple collision

[ Upstream commit 13c62f5371e3eb4fc3400cfa26e64ca75f888008 ]

This this the counterpart of 8aa7b526dc0b ("openvswitch: handle DNAT
tuple collision") for act_ct. From that commit changelog:

"""
With multiple DNAT rules it's possible that after destination
translation the resulting tuples collide.

...

Netfilter handles this case by allocating a null binding for SNAT at
egress by default.  Perform the same operation in openvswitch for DNAT
if no explicit SNAT is requested by the user and allocate a null binding
for SNAT for packets in the "original" direction.
"""

Fixes: 95219afbb980 ("act_ct: support asymmetric conntrack")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/act_ct.c