From: Anil Madhavapeddy Date: Tue, 22 Aug 2006 13:59:16 +0000 (+0100) Subject: Make add_to_bridge() always leave the device up even when it bails out due to the... X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15710^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=973bbebcc3a29a334bc3c8da2d816e39f81230a2;p=xen.git 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 --- diff --git a/tools/examples/xen-network-common.sh b/tools/examples/xen-network-common.sh index 37bdd77586..4c230a6402 100644 --- a/tools/examples/xen-network-common.sh +++ b/tools/examples/xen-network-common.sh @@ -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}