openvswitch: add seqadj extension when NAT is used.
Subsystems (4)
PATCH 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 | 5 +++++ 1 file changed, 5 insertions(+)
net/openvswitch/conntrack.c +5 -0
@@ -990,6 +990,11 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, GFP_ATOMIC);if (err)return err; + +if (info->nat &&nfct_help (ct) && !nfct_seqadj (ct)) { +if (!nfct_seqadj_ext_add (ct)) +return -EINVAL ; + } }/* Call the helper only if:
Signature · 1 line
2.20.1
Quoted 9 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.
Quoted 6 lines
Fixes 16ec3d4fbb96 ("openvswitch: Fix cached ct with helper.")Signed-off-by Flavio Leitner <[email protected]>--- net/openvswitch/conntrack.c | 5 +++++ 1 file changed, 5 insertions(+)
I am not able to apply this patch.
net/openvswitch/conntrack.c static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, · line 994
Quoted 10 lines
net/openvswitch/conntrack.c +2
-0@@ -990,6 +990,11 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, GFP_ATOMIC);if (err)return err; + +if (info->nat &&nfct_help (ct) && !nfct_seqadj (ct)) {
Given helper is just assigned, is nfct_help() check required here?
Quoted 11 lines
net/openvswitch/conntrack.c +3
-1+if (!nfct_seqadj_ext_add (ct)) +return -EINVAL ; + } }/* Call the helper only if: -- 2.20.1
Quoted 10 lines · Pravin Shelar
Quoted 9 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.
Quoted 7 lines
Quoted 6 lines
Fixes 16ec3d4fbb96 ("openvswitch: Fix cached ct with helper.")Signed-off-by Flavio Leitner <[email protected]>--- net/openvswitch/conntrack.c | 5 +++++ 1 file changed, 5 insertions(+)I am not able to apply this patch.
This is for Davem net-next. I got the patch from ML and it worked for me.
Quoted 11 lines
net/openvswitch/conntrack.c static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, · line 994
Quoted 10 lines
net/openvswitch/conntrack.c +2
-0@@ -990,6 +990,11 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, GFP_ATOMIC);if (err)return err; + +if (info->nat &&nfct_help (ct) && !nfct_seqadj (ct)) {Given helper is just assigned, is
nfct_help()check required here?
I tried to be very clear, but you're right that it's not required. I will post a v2 removing that.
Thanks
fbl
Quoted 12 lines
Quoted 12 lines
net/openvswitch/conntrack.c +3
-1+if (!nfct_seqadj_ext_add (ct)) +return -EINVAL ; + } }/* Call the helper only if: -- 2.20.1