Unverified Commit 88e27cd6 by Stéphane Graber Committed by GitHub

Merge pull request #3699 from brauner/2021-02-26/network

network: fix networks with switched names
parents 32d40452 3a197a1b
...@@ -165,7 +165,7 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail ...@@ -165,7 +165,7 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail
__do_free struct lxc_netdev *netdev = NULL; __do_free struct lxc_netdev *netdev = NULL;
/* network does not exist */ /* network does not exist */
netdev = malloc(sizeof(*netdev)); netdev = zalloc(sizeof(*netdev));
if (!netdev) if (!netdev)
return ret_set_errno(NULL, ENOMEM); return ret_set_errno(NULL, ENOMEM);
...@@ -177,7 +177,7 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail ...@@ -177,7 +177,7 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail
netdev->idx = idx; netdev->idx = idx;
/* prepare new list */ /* prepare new list */
newlist = malloc(sizeof(*newlist)); newlist = zalloc(sizeof(*newlist));
if (!newlist) if (!newlist)
return ret_set_errno(NULL, ENOMEM); return ret_set_errno(NULL, ENOMEM);
......
...@@ -165,6 +165,7 @@ struct lxc_netdev { ...@@ -165,6 +165,7 @@ struct lxc_netdev {
bool l2proxy; bool l2proxy;
char name[IFNAMSIZ]; char name[IFNAMSIZ];
char created_name[IFNAMSIZ]; char created_name[IFNAMSIZ];
char transient_name[IFNAMSIZ];
char *hwaddr; char *hwaddr;
char *mtu; char *mtu;
union netdev_p priv; union netdev_p priv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment