summaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
authorFlavio Leitner <fbl@sysclose.org>2019-03-25 15:58:31 -0300
committerDavid S. Miller <davem@davemloft.net>2019-03-26 12:48:23 -0700
commitfa7e428c6b7ed3281610511a2b2ec716d9894be8 (patch)
tree998b9530494e7e7396064ed05a7341f2ddc2be0d /net/openvswitch
parent0a25d92c6f4facaf2852f1aac4cebfe01dd57a91 (diff)
downloadlinux-fa7e428c6b7ed3281610511a2b2ec716d9894be8.tar.bz2
openvswitch: add seqadj extension when NAT is used.
When the conntrack is initialized, there is no helper attached yet so the nat info initialization (nf_nat_setup_info) skips adding the seqadj ext. A helper is attached later when the conntrack is not confirmed but is going to be committed. In this case, if NAT is needed then adds the seqadj ext as well. Fixes: 16ec3d4fbb96 ("openvswitch: Fix cached ct with helper.") Signed-off-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/conntrack.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 51080004677e..845b83598e0d 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -990,6 +990,12 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
GFP_ATOMIC);
if (err)
return err;
+
+ /* helper installed, add seqadj if NAT is required */
+ if (info->nat && !nfct_seqadj(ct)) {
+ if (!nfct_seqadj_ext_add(ct))
+ return -EINVAL;
+ }
}
/* Call the helper only if: