From: Christian Brauner Date: Wed, 9 Dec 2020 08:31:30 +0000 (+0100) Subject: confile: cleanup get_config_net_veth_ipv6_route() X-Git-Tag: lxc-5.0.0~330^2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=984853899a7f584fe4d0f67fbd48ad32847ec969;p=thirdparty%2Flxc.git confile: cleanup get_config_net_veth_ipv6_route() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 4ec66bf94..2f55e6278 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -6140,7 +6140,7 @@ static int get_config_net_ipv6_address(const char *key, char *retv, int inlen, } static int get_config_net_veth_ipv6_route(const char *key, char *retv, int inlen, - struct lxc_conf *c, void *data) + struct lxc_conf *c, void *data) { int len; size_t listlen; @@ -6155,7 +6155,7 @@ static int get_config_net_veth_ipv6_route(const char *key, char *retv, int inlen memset(retv, 0, inlen); if (!netdev) - return ret_set_errno(-1, EINVAL); + return ret_errno(EINVAL); if (netdev->type != LXC_NET_VETH) return 0; @@ -6164,7 +6164,8 @@ static int get_config_net_veth_ipv6_route(const char *key, char *retv, int inlen lxc_list_for_each(it, &netdev->priv.veth_attr.ipv6_routes) { 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" : ""); }