On Fri, 14 Jun 2024 16:13:38 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote:Currently the code to translate host side addresses and ports to guest side addresses and ports, and vice versa, is scattered across the TCP code. This includes both port redirection as controlled by the -t and -T options, and our special case NAT controlled by the --no-map-gw option. Gather this logic into fwd_nat_from_*() functions for each input interface in fwd.c which take protocol and address information for the initiating side and generates the pif and address information for the forwarded side. This performs any NAT or port forwarding needed. We create a flow_target() helper which applies those forwarding functions as needed to automatically move a flow from INI to TGT state.Given that you already added flow_target() in another series, I didn't really review that part of this patch as I guess it will change. The rest of the patches from 8/26 to 17/26 all look good to me: after all, changes from v5 look rather minimal for those. I didn't review patches starting from 18/26, as you mentioned they will change substantially. -- Stefano