mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
net/sched: act_ct: handle DNAT tuple collision
[ Upstream commit13c62f5371] This this the counterpart of8aa7b526dc("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:95219afbb9("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>
This commit is contained in:
parent
c8f1437c01
commit
4733b73709
|
|
@ -900,14 +900,19 @@ static int tcf_ct_act_nat(struct sk_buff *skb,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ct_nat_execute(skb, ct, ctinfo, range, maniptype);
|
err = ct_nat_execute(skb, ct, ctinfo, range, maniptype);
|
||||||
if (err == NF_ACCEPT &&
|
if (err == NF_ACCEPT && ct->status & IPS_DST_NAT) {
|
||||||
ct->status & IPS_SRC_NAT && ct->status & IPS_DST_NAT) {
|
if (ct->status & IPS_SRC_NAT) {
|
||||||
if (maniptype == NF_NAT_MANIP_SRC)
|
if (maniptype == NF_NAT_MANIP_SRC)
|
||||||
maniptype = NF_NAT_MANIP_DST;
|
maniptype = NF_NAT_MANIP_DST;
|
||||||
else
|
else
|
||||||
maniptype = NF_NAT_MANIP_SRC;
|
maniptype = NF_NAT_MANIP_SRC;
|
||||||
|
|
||||||
err = ct_nat_execute(skb, ct, ctinfo, range, maniptype);
|
err = ct_nat_execute(skb, ct, ctinfo, range,
|
||||||
|
maniptype);
|
||||||
|
} else if (CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL) {
|
||||||
|
err = ct_nat_execute(skb, ct, ctinfo, NULL,
|
||||||
|
NF_NAT_MANIP_SRC);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user