mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Make add_to_bridge() always leave the device up even when it bails out due to the device already being present on the bridge.
This makes the script more idempotent if run twice (e.g. from hotplug and udev), since the second time the device will be taken down and not brought up again, leaving the host without networking. Signed-off-by: Anil Madhavapeddy <anil@xensource.com>
This commit is contained in:
1 parent
5db8d219b0
commit
973bbebcc3
1 file changed
+1
@@ -143,6 +143,7 @@ add_to_bridge () {
|
||||
|
||||
# Don't add $dev to $bridge if it's already on a bridge.
|
||||
if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then
|
||||
ip link set ${dev} up || true
|
||||
return
|
||||
fi
|
||||
brctl addif ${bridge} ${dev}
|
||||
|
||||