confile: cleanup get_config_net_veth_ipv6_route()

parent 492955be
...@@ -5694,7 +5694,7 @@ static int get_config_net_ipv6_address(const char *key, char *retv, int inlen, ...@@ -5694,7 +5694,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, 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; int len;
size_t listlen; size_t listlen;
...@@ -5709,7 +5709,7 @@ static int get_config_net_veth_ipv6_route(const char *key, char *retv, int inlen ...@@ -5709,7 +5709,7 @@ static int get_config_net_veth_ipv6_route(const char *key, char *retv, int inlen
memset(retv, 0, inlen); memset(retv, 0, inlen);
if (!netdev) if (!netdev)
return ret_set_errno(-1, EINVAL); return ret_errno(EINVAL);
if (netdev->type != LXC_NET_VETH) if (netdev->type != LXC_NET_VETH)
return 0; return 0;
...@@ -5718,7 +5718,8 @@ static int get_config_net_veth_ipv6_route(const char *key, char *retv, int inlen ...@@ -5718,7 +5718,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) { lxc_list_for_each(it, &netdev->priv.veth_attr.ipv6_routes) {
struct lxc_inet6dev *i = it->elem; 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, strprint(retv, inlen, "%s/%u%s", buf, i->prefix,
(listlen-- > 1) ? "\n" : ""); (listlen-- > 1) ? "\n" : "");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment