Subject: Re: [PATCHv4 net-next 5/5] net: move the nat function to nf_nat_ovs for ovs and tc

From: Pablo Neira Ayuso <[email-masked]>
Date: Fri, 9 Dec 2022 16:21:41 +0100

On Thu, Dec 08, 2022 at 11:56:12AM -0500, Xin Long wrote:
> There are two nat functions are nearly the same in both OVS and
> TC code, (ovs_)ct_nat_execute() and ovs_ct_nat/tcf_ct_act_nat().
> 
> This patch creates nf_nat_ovs.c under netfilter and moves them
> there then exports nf_ct_nat() so that it can be shared by both
> OVS and TC, and keeps the nat (type) check and nat flag update
> in OVS and TC's own place, as these parts are different between
> OVS and TC.
> 
> Note that in OVS nat function it was using skb->protocol to get
> the proto as it already skips vlans in key_extract(), while it
> doesn't in TC, and TC has to call skb_protocol() to get proto.
> So in nf_ct_nat_execute(), we keep using skb_protocol() which
> works for both OVS and TC contrack.
> 
> Signed-off-by: Xin Long <[email-masked]>

Acked-by: Pablo Neira Ayuso <[email-masked]>

Thanks for addressing my feedback.