[No Network] ifupdown/bridge-utils & udev/bridge-utils race condition preventing the addition of non-pre-up ports to a bridge
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bridge-utils (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Problem:
I have configured a bridge (br0) between a physical port (eth0) and a tap device (tap0) using the ifupdown package. About 75% of the time eth0 fails to be added to br0 during boot, leaving networking inoperable. This suggests a race condition between ifupdown/
Layout:
Files involved:
/etc/network/
/etc/network/
/lib/bridge-
/var/log/
/var/log/
/lib/udev/
/lib/udev/
/etc/default/
This rules out conflict between ifupdown's sysvinit and upstart integration:
$ find /etc/rc?.d/ -iname '*network*'
/etc/rc0.
/etc/rc6.
$ find /etc/init* -iname '*network*' | sort
/etc/init.
/etc/init/
/etc/init/
/etc/init/
/etc/init/
This rules out conflict between ifupdown/
...:/etc/network$ tree
.
+-- if-down.d
¦ +-- bind9
¦ +-- openvpn
¦ +-- postfix
¦ +-- resolvconf
¦ +-- upstart
¦ +-- wpasupplicant -> ../../wpa_
+-- if-post-down.d
¦ +-- avahi-daemon -> ../if-up.
¦ +-- bridge -> /lib/bridge-
¦ +-- vde2
¦ +-- wireless-tools
¦ +-- wpasupplicant -> ../../wpa_
+-- if-pre-up.d
¦ +-- bridge -> /lib/bridge-
¦ +-- ethtool
¦ +-- vde2
¦ +-- wireless-tools
¦ +-- wpasupplicant -> ../../wpa_
+-- if-up.d
¦ +-- 000resolvconf
¦ +-- avahi-daemon
¦ +-- bind9
¦ +-- ethtool
¦ +-- ntpdate
¦ +-- openssh-server
¦ +-- openvpn
¦ +-- postfix
¦ +-- upstart
¦ +-- wpasupplicant -> ../../wpa_
+-- interfaces
+-- interfaces.d
+-- run -> /run/network
Software Versions:
Ubuntu 14.04 LTS
ifupdown 0.7.47.2ubuntu4
bridge-utils 1.5-6ubuntu2
upstart 1.12.1-0ubuntu4
udev 204-5ubuntu20
Logs:
/var/log/
Sun Apr 27 17:27:03 2014 TUN/TAP device tap0 opened
Sun Apr 27 17:27:03 2014 Persist state set to: ON
device br0 already exists; can't create bridge with the same name
run-parts: /etc/network/
Internet Systems Consortium DHCP Client 4.2.4
...
Listening on LPF/br0/
Sending on LPF/br0/
Sending on Socket/fallback
DHCPDISCOVER on br0 to 255.255.255.255 port 67 interval 3 (xid=0x5d7de88)
...
<<Fails to obtain lease>>>
/var/log/
ifup: interface br0 already configured
My ifupdown configuration:
/etc/init.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet dhcp
pre-up openvpn --mktun --dev tap0
Demonstrating that "pre-up openvpn --mktun --dev tap0" triggers /lib/udev/
$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000129f5f026 no eth0
$ sudo ip tuntap del mode tap tap0
KERNEL[
UDEV [59526.263236] remove /devices/
$ pre-up openvpn --mktun --dev tap0
Mon Apr 28 10:00:32 2014 TUN/TAP device tap0 opened
Mon Apr 28 10:00:32 2014 Persist state set to: ON
KERNEL[
UDEV [59622.323388] add /devices/
$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000129f5f026 no eth0
Confirming the problem:
By default, BRIDGE_HOTPLUG=yes in /etc/default/
Note that this resolves the problem and the errors logged to /var/log/
Discussion:
Disabling BRIDGE_HOTPLUG is only a temporary hack. I have a third interface I would like to bridge which does require hotplug support.
Possible Solution
* Disable hotplugging for virtual adapters
* Disable hotplugging for a user-defined list of interfaces
* Fix the race condition?
Not sure how, both /etc/network/
"if ... [ ! -d /sys/class/
description: | updated |
summary: |
- [network unconfigured] bridge-utils & ifupdown/udev conflict with - vpn/tap pre-up + [network unconfigured] ifupdown/bridge-utils & udev/bridge-utils race + condition preventing the n of non-pre-up |
summary: |
[network unconfigured] ifupdown/bridge-utils & udev/bridge-utils race - condition preventing the n of non-pre-up + condition preventing the n of non-pre-up ports to a bridge |
summary: |
[network unconfigured] ifupdown/bridge-utils & udev/bridge-utils race - condition preventing the n of non-pre-up ports to a bridge + condition preventing the addition of non-pre-up ports to a bridge |
summary: |
- [network unconfigured] ifupdown/bridge-utils & udev/bridge-utils race - condition preventing the addition of non-pre-up ports to a bridge + [No Network] ifupdown/bridge-utils & udev/bridge-utils race condition + preventing the addition of non-pre-up ports to a bridge |
Changed in bridge-utils (Ubuntu): | |
assignee: | nobody → Stéphane Graber (stgraber) |
Changed in bridge-utils (Ubuntu): | |
assignee: | Stéphane Graber (stgraber) → nobody |
Status changed to 'Confirmed' because the bug affects multiple users.