Re: [libnetfilter_conntrack PATCH 2/3] src: add support for IPv6 NAT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 17, 2016 at 02:50:37PM +0200, Arturo Borrero Gonzalez wrote:
> The conntrackd daemon lacks support for syncing IPv6 NATed connections.
> 
> This patch adds support for managing the IPv6 part of struct __nfct_nat,
> also updating the corresponsing symbols.
> 
> Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
> ---
>  .../libnetfilter_conntrack.h                       |    2 +
>  src/conntrack/build.c                              |   34 ++++++++++++++++++++
>  src/conntrack/build_mnl.c                          |   34 ++++++++++++++++++++
>  src/conntrack/copy.c                               |   16 +++++++++
>  src/conntrack/getter.c                             |   12 +++++++
>  src/conntrack/objopt.c                             |   26 ++++++++++++++-
>  src/conntrack/setter.c                             |   16 +++++++++
>  7 files changed, 138 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libnetfilter_conntrack/libnetfilter_conntrack.h b/include/libnetfilter_conntrack/libnetfilter_conntrack.h
> index 22af622..6cba578 100644
> --- a/include/libnetfilter_conntrack/libnetfilter_conntrack.h
> +++ b/include/libnetfilter_conntrack/libnetfilter_conntrack.h
> @@ -138,6 +138,8 @@ enum nf_conntrack_attr {
>  	ATTR_CONNLABELS_MASK,			/* variable length */
>  	ATTR_ORIG_ZONE,				/* u16 bits */
>  	ATTR_REPL_ZONE,				/* u16 bits */
> +	ATTR_SNAT_IPV6,				/* u128 bits */
> +	ATTR_DNAT_IPV6,				/* u128 bits */
>  	ATTR_MAX
>  };
>  
> diff --git a/src/conntrack/build.c b/src/conntrack/build.c
> index 10d51fe..0b15230 100644
> --- a/src/conntrack/build.c
> +++ b/src/conntrack/build.c
> @@ -284,6 +284,8 @@ static void __build_nat(struct nfnlhdr *req,
>  			       &nat->min_ip.v4, sizeof(uint32_t));
>  		break;
>  	case AF_INET6:
> +		nfnl_addattr_l(&req->nlh, size, CTA_NAT_MINIP,
> +			       &nat->min_ip.v6, sizeof(struct in6_addr));

This should be CTA_NAT_V6_MINIP instead of CTA_NAT_MINIP.

enum ctattr_nat {
        CTA_NAT_UNSPEC,
        CTA_NAT_V4_MINIP,
#define CTA_NAT_MINIP CTA_NAT_V4_MINIP
        CTA_NAT_V4_MAXIP,
#define CTA_NAT_MAXIP CTA_NAT_V4_MAXIP
        CTA_NAT_PROTO,
        CTA_NAT_V6_MINIP,
        CTA_NAT_V6_MAXIP,
        __CTA_NAT_MAX
};
#define CTA_NAT_MAX (__CTA_NAT_MAX - 1)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux