Commit 6b1aa947 by hallyn

Merge pull request #397 from axn/master

Fix instantiation of multiple vlan interfaces with same id
parents 4662c6de 82f58d03
......@@ -2735,13 +2735,14 @@ static int instantiate_vlan(struct lxc_handler *handler, struct lxc_netdev *netd
{
char peer[IFNAMSIZ];
int err;
static uint16_t vlan_cntr = 0;
if (!netdev->link) {
ERROR("no link specified for vlan netdev");
return -1;
}
err = snprintf(peer, sizeof(peer), "vlan%d", netdev->priv.vlan_attr.vid);
err = snprintf(peer, sizeof(peer), "vlan%d-%d", netdev->priv.vlan_attr.vid, vlan_cntr++);
if (err >= sizeof(peer)) {
ERROR("peer name too long");
return -1;
......
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