Skip to content

Commit

Permalink
Make interface notifier to act only in default namespace
Browse files Browse the repository at this point in the history
vRouter listens for netdevice register/unregister events so that it
can cleanup its view of interfaces that it uses. The way vRouter
identifies an interface is through the name of the interface.

When docker is run, docker also can create interfaces with the same
name and interface index, albeit in a different name space. In this
particular case, docker creates a veth pair, assigns name of "eth0"
to one part of the pair (that is used by the container) and at exit
deletes the interface. vRouter wrongly assumes that the "eth0" delete
is really for the "eth0" in the default name space and detaches the
interface from vRouter.

Change-Id: I2ba384ba2b85f19f8e666d858da0ff443dacc7ec
Closes-BUG: #1449919
  • Loading branch information
anandhk-juniper committed May 8, 2015
1 parent d223c6b commit 4992c10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion linux/vr_host_interface.c
Expand Up @@ -2249,6 +2249,12 @@ linux_if_notifier(struct notifier_block * __unused,
dev = (struct net_device *)arg;
#endif

#ifdef CONFIG_NET_NS
if (dev->nd_net != &init_net) {
return NOTIFY_DONE;
}
#endif

if (!router)
return NOTIFY_DONE;

Expand Down Expand Up @@ -2279,7 +2285,6 @@ linux_if_notifier(struct notifier_block * __unused,
vhost_attach_phys(dev);
}


return NOTIFY_DONE;
}

Expand Down

0 comments on commit 4992c10

Please sign in to comment.