]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: cleanup get_config_net_ipv6_address()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 9 Dec 2020 08:31:01 +0000 (09:31 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 9 Dec 2020 14:01:48 +0000 (15:01 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
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" : "");
        }