Skip to content

Commit 06c5e46

Browse files
committed
openvswitch: return NF_DROP when fails to add nat ext in ovs_ct_nat
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2163374 Upstream Status: linux.git commit 2b85144 Author: Xin Long <lucien.xin@gmail.com> Date: Thu Dec 8 11:56:10 2022 -0500 openvswitch: return NF_DROP when fails to add nat ext in ovs_ct_nat When it fails to allocate nat ext, the packet should be dropped, like the memory allocation failures in other places in ovs_ct_nat(). This patch changes to return NF_DROP when fails to add nat ext before doing NAT in ovs_ct_nat(), also it would keep consistent with tc action ct' processing in tcf_ct_act_nat(). Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Antoine Tenart <atenart@redhat.com>
1 parent 4f41252 commit 06c5e46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/openvswitch/conntrack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key,
880880

881881
/* Add NAT extension if not confirmed yet. */
882882
if (!nf_ct_is_confirmed(ct) && !nf_ct_nat_ext_add(ct))
883-
return NF_ACCEPT; /* Can't NAT. */
883+
return NF_DROP; /* Can't NAT. */
884884

885885
/* Determine NAT type.
886886
* Check if the NAT type can be deduced from the tracked connection.

0 commit comments

Comments
 (0)