Unverified Commit fc0a8697 by Christian Brauner Committed by Stéphane Graber

network: fix {mac,ip,v}lan device creation

parent df7d58b7
...@@ -482,6 +482,8 @@ static int instantiate_macvlan(struct lxc_handler *handler, struct lxc_netdev *n ...@@ -482,6 +482,8 @@ static int instantiate_macvlan(struct lxc_handler *handler, struct lxc_netdev *n
goto on_error; goto on_error;
} }
strlcpy(netdev->created_name, peer, IFNAMSIZ);
netdev->ifindex = if_nametoindex(peer); netdev->ifindex = if_nametoindex(peer);
if (!netdev->ifindex) { if (!netdev->ifindex) {
ERROR("Failed to retrieve ifindex for \"%s\"", peer); ERROR("Failed to retrieve ifindex for \"%s\"", peer);
...@@ -3115,9 +3117,9 @@ int lxc_network_move_created_netdev_priv(struct lxc_handler *handler) ...@@ -3115,9 +3117,9 @@ int lxc_network_move_created_netdev_priv(struct lxc_handler *handler)
physname = is_wlan(netdev->link); physname = is_wlan(netdev->link);
if (physname) if (physname)
ret = lxc_netdev_move_wlan(physname, netdev->link, pid, netdev->name); ret = lxc_netdev_move_wlan(physname, netdev->link, pid, NULL);
else else
ret = lxc_netdev_move_by_index(netdev->ifindex, pid, netdev->name); ret = lxc_netdev_move_by_index(netdev->ifindex, pid, NULL);
if (ret) if (ret)
return log_error_errno(-1, -ret, "Failed to move network device \"%s\" with ifindex %d to network namespace %d", return log_error_errno(-1, -ret, "Failed to move network device \"%s\" with ifindex %d to network namespace %d",
netdev->created_name, netdev->created_name,
......
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