@@ -126,16 +126,18 @@ add_to_bridge () {
local bridge=$1
local dev=$2
- # 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 ${dev} up || true
- return
- fi
- if which brctl >&/dev/null; then
- brctl addif ${bridge} ${dev}
+ # Don't add $dev to $bridge if it's already on the bridge.
+ if [ ! -e "/sys/class/net/${bridge}/brif/${dev}" ]; then
+ log debug "adding $dev to bridge $bridge"
+ if which brctl >&/dev/null; then
+ brctl addif ${bridge} ${dev}
+ else
+ ip link set ${dev} master ${bridge}
+ fi
else
- ip link set ${dev} master ${bridge}
+ log debug "$dev already on bridge $bridge"
fi
+
ip link set dev ${dev} up
}