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:
Anil Madhavapeddy committed 2006-08-22 14:59:16 +01:00
1 parent 5db8d219b0
commit 973bbebcc3
1 file changed
+1
+1
View File
@@ -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}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.