diff options
author | Xin Long <lucien.xin@gmail.com> | 2022-12-08 17:56:10 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-12 11:14:03 +0100 |
commit | 2b85144ab36e0e870f59b5ae55e299179eb8cdb8 (patch) | |
tree | 37beb5cb553e53e72262edfa045ff00a04768ab7 /net/openvswitch | |
parent | openvswitch: return NF_ACCEPT when OVS_CT_NAT is not set in info nat (diff) | |
download | linux-2b85144ab36e0e870f59b5ae55e299179eb8cdb8.tar.xz linux-2b85144ab36e0e870f59b5ae55e299179eb8cdb8.zip |
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>
Diffstat (limited to 'net/openvswitch')
-rw-r--r-- | net/openvswitch/conntrack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index 5ea74270da46..58c9f0edc3c4 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -821,7 +821,7 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key, /* Add NAT extension if not confirmed yet. */ if (!nf_ct_is_confirmed(ct) && !nf_ct_nat_ext_add(ct)) - return NF_ACCEPT; /* Can't NAT. */ + return NF_DROP; /* Can't NAT. */ /* Determine NAT type. * Check if the NAT type can be deduced from the tracked connection. |