Skip to content

Commit

Permalink
confile: cleanup get_config_net_ipv4_address()
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 42ceb01 commit a1fd71e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lxc/confile.c
Expand Up @@ -5584,13 +5584,14 @@ static int get_config_net_ipv4_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->ipv4);

lxc_list_for_each(it, &netdev->ipv4) {
struct lxc_inetdev *i = it->elem;
inet_ntop(AF_INET, &i->addr, buf, sizeof(buf));
if (!inet_ntop(AF_INET, &i->addr, buf, sizeof(buf)))
return -errno;
strprint(retv, inlen, "%s/%u%s", buf, i->prefix,
(listlen-- > 1) ? "\n" : "");
}
Expand Down

0 comments on commit a1fd71e

Please sign in to comment.