From: Christian Brauner Date: Wed, 9 Dec 2020 08:31:01 +0000 (+0100) Subject: confile: cleanup get_config_net_ipv6_address() X-Git-Tag: lxc-5.0.0~330^2~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=396acb62def1903d9cdce8c4507cf63df2972752;p=thirdparty%2Flxc.git confile: cleanup get_config_net_ipv6_address() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 8e2012f39..4ec66bf94 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -6124,13 +6124,14 @@ static int get_config_net_ipv6_address(const char *key, char *retv, int inlen, memset(retv, 0, inlen); if (!netdev) - return -1; + return ret_errno(EINVAL); listlen = lxc_list_len(&netdev->ipv6); lxc_list_for_each(it, &netdev->ipv6) { struct lxc_inet6dev *i = it->elem; - inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf)); + if (!inet_ntop(AF_INET6, &i->addr, buf, sizeof(buf))) + return -errno; strprint(retv, inlen, "%s/%u%s", buf, i->prefix, (listlen-- > 1) ? "\n" : ""); }