Skip to content

Commit

Permalink
datapath: add seqadj extension when NAT is used.
Browse files Browse the repository at this point in the history
upstream patch:

commit fa7e428c6b7ed3281610511a2b2ec716d9894be8
Author: Flavio Leitner <[email protected]>
Date:   Mon Mar 25 15:58:31 2019 -0300

    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 <[email protected]>
    Acked-by: Pravin B Shelar <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Signed-off-by: Yi-Hung Wei <[email protected]>
Reviewed-by: Yifeng Sun <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
fleitner authored and blp committed Oct 18, 2019
1 parent 9ea96dc commit 0e34479
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datapath/conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,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:
Expand Down

0 comments on commit 0e34479

Please sign in to comment.