[lxc-devel] [PATCH] Fix presentation of IPv6 addresses and gateway

Stéphane Graber stgraber at ubuntu.com
Wed Sep 24 14:27:04 UTC 2014


Patch looks good, I'm also pretty surprised nobody noticed before
because the output must have been pretty awful until that patch :)

Can you just reply to this e-mail with your Signed-off-by line so I can
include this in master?

Thanks!

On Wed, Sep 24, 2014 at 10:08:50AM -0300, Andre Nathan wrote:
> ---
>  src/lxc/confile.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/lxc/confile.c b/src/lxc/confile.c
> index 0e932c6..9af2aa4 100644
> --- a/src/lxc/confile.c
> +++ b/src/lxc/confile.c
> @@ -2216,15 +2216,15 @@ static int lxc_get_item_nic(struct lxc_conf *c, char *retv, int inlen,
>  		if (netdev->ipv6_gateway_auto) {
>  			strprint(retv, inlen, "auto");
>  		} else if (netdev->ipv6_gateway) {
> -			char buf[INET_ADDRSTRLEN];
> -			inet_ntop(AF_INET, netdev->ipv6_gateway, buf, sizeof(buf));
> +			char buf[INET6_ADDRSTRLEN];
> +			inet_ntop(AF_INET6, netdev->ipv6_gateway, buf, sizeof(buf));
>  			strprint(retv, inlen, "%s", buf);
>  		}
>  	} else if (strcmp(p1, "ipv6") == 0) {
>  		struct lxc_list *it2;
>  		lxc_list_for_each(it2, &netdev->ipv6) {
> -			struct lxc_inetdev *i = it2->elem;
> -			char buf[INET_ADDRSTRLEN];
> +			struct lxc_inet6dev *i = it2->elem;
> +			char buf[INET6_ADDRSTRLEN];
>  			inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf));
>  			strprint(retv, inlen, "%s\n", buf);
>  		}
> -- 
> 1.9.1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140924/9e50526f/attachment.sig>


More information about the lxc-devel mailing list