[ovs-dev] [PATCH v2 8/8] conntrack action: Add support for NAT.

Ben Pfaff blp at ovn.org
Tue Nov 24 21:51:39 UTC 2015


On Fri, Nov 06, 2015 at 04:10:55PM -0800, Jarno Rajahalme wrote:
> Extend OVS conntrack interface to cover NAT.  New nested nat action
> may be included with a CT action.  A bare nat action only mangles
> existing connections.  If a nat action with src or dst range attribute
> is included, new (non-committed) connections are mangled according to
> the nat attributes.
> 
> This work extends on a branch by Thomas Graf at
> https://github.com/tgraf/ovs/tree/nat.
> 
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>

In format_odp_ct_nat() here, I'd replace the memcpy() calls by struct
assignment plus format_odp_ct_nat():
> +    if (addr_len == sizeof ip6_min) {
> +        memcpy(&ip6_min, a[OVS_NAT_ATTR_IP_MIN]
> +               ? nl_attr_get(a[OVS_NAT_ATTR_IP_MIN]) : &in6addr_any,
> +               sizeof ip6_min);
> +        memcpy(&ip6_max, a[OVS_NAT_ATTR_IP_MAX]
> +               ? nl_attr_get(a[OVS_NAT_ATTR_IP_MAX]) : &in6addr_any,
> +               sizeof ip6_max);
> +    }

Acked-by: Ben Pfaff <blp at ovn.org>



More information about the dev mailing list