diff --git a/weave b/weave index a4f787cc..cae010b1 100755 --- a/weave +++ b/weave @@ -571,7 +571,7 @@ detect_bridge_type() { MTU=${WEAVE_MTU:-$(cat /sys/class/net/$BRIDGE/mtu)} } -create_bridge() { +try_create_bridge() { if ! detect_bridge_type ; then BRIDGE_TYPE=bridge if [ -z "$WEAVE_NO_FASTDP" ] ; then @@ -656,6 +656,16 @@ EOF configure_arp_cache $BRIDGE } +create_bridge() { + if ! try_create_bridge "$@" ; then + echo "Creating bridge '$BRIDGE' failed" >&2 + # reset to original value so we destroy both kinds + DATAPATH=datapath + destroy_bridge + exit 1 + fi +} + expose_ip() { ipam_cidrs allocate_no_check_alive weave:expose $CIDR_ARGS for CIDR in $ALL_CIDRS ; do