]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/confile.c
confile: cleanup get_config_net_ipv6_address()
[mirror_lxc.git] / src / lxc / confile.c
index 8e2012f3905857c4b3e560c5ae650a7decaf095d..4ec66bf94e0a7e0f182b0089a23e432443927533 100644 (file)
@@ -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" : "");
        }