openvswitch: add seqadj extension when NAT is used.
Subsystems (4)
PATCH v2 1/1 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.
--- net/openvswitch/conntrack.c | 6 ++++++ 1 file changed, 6 insertions(+)
Changelog:
v2 - removed nfct_help(ct) check as it is not necessary.
net/openvswitch/conntrack.c +6 -0
@@ -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:
Signature · 1 line
2.20.1
Quoted 25 lines · Flavio Leitner
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 <[email protected]>--- net/openvswitch/conntrack.c | 6 ++++++ 1 file changed, 6 insertions(+)Changelog:
v2 - removednfct_help(ct)check as it is not necessary.net/openvswitch/conntrack.c +0
-0@@ -990,6 +990,12 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, GFP_ATOMIC);if (err)
net/openvswitch/conntrack.c static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, · line 1001
Quoted 10 lines
net/openvswitch/conntrack.c +6
-0return 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:
Thanks,
Pravin.
From: Flavio Leitner <[email protected]>
Date: Mon, 25 Mar 2019 15:58:31 -0300
Quoted 10 lines
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 <[email protected]>
Applied.