]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: cleanup get_config_net_veth_ipv6_route()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 9 Dec 2020 08:31:30 +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 4ec66bf94e0a7e0f182b0089a23e432443927533..2f55e6278bd16d48057263d20b510be36627093e 100644 (file)
@@ -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" : "");
        }