Skip to content

Commit

Permalink
confile: cleanup get_config_net_ipv6_gateway()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 15, 2020
1 parent a6ad2ac commit 79b7346
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lxc/confile.c
Expand Up @@ -5647,14 +5647,15 @@ static int get_config_net_ipv6_gateway(const char *key, char *retv, int inlen,
memset(retv, 0, inlen);

if (!netdev)
return -1;
return ret_errno(EINVAL);

if (netdev->ipv6_gateway_auto) {
strprint(retv, inlen, "auto");
} else if (netdev->ipv6_gateway_dev) {
strprint(retv, inlen, "dev");
} else if (netdev->ipv6_gateway) {
inet_ntop(AF_INET6, netdev->ipv6_gateway, buf, sizeof(buf));
if (!inet_ntop(AF_INET6, netdev->ipv6_gateway, buf, sizeof(buf)))
return -errno;
strprint(retv, inlen, "%s", buf);
}

Expand Down

0 comments on commit 79b7346

Please sign in to comment.