Hi! It's been a long time since this bug entered the system, and now I have a patch for it, I have to say it is a little dirty (I'm just adding the bridge back on the stances that had it removed before them) so that way they won't fail when trying to remove it.
This will work if you do: ln -s /lib/bridge-utils/ifupdown.sh /etc/network/if-down.d/bridge and apply the attached patch. I'd love to see comments on this, even though more than 15 years later... well who knows. Whis patch is a little big, so I don't know if it will make it to Bullseye at this time of the freeze :-( so all the testing will be welcome and will of course help get it on Bullseye. Regards.... -- Manty/BestiaTester -> http://manty.net
--- ifupdown.sh.orig 2021-02-17 03:53:52.414027536 +0100 +++ ifupdown.sh 2021-02-17 03:51:29.029521766 +0100 @@ -67,7 +67,11 @@ fi # Previous work (stop the interface) elif [ "$MODE" = "stop" ]; then + if [ "$PHASE" = "pre-down" ]; then + [ ! -d /sys/class/net/$IFACE ] && brctl addbr $IFACE && ip address add "$IF_ADDRESS"/"$IF_NETMASK" dev $IFACE + elif [ "$PHASE" = "post-down" ]; then ip link set dev $IFACE down || exit 1 + fi fi all_interfaces= && @@ -100,7 +104,7 @@ fi brctl addif $IFACE $port && ip link set dev $port up # We detach each port of the bridge - elif [ "$MODE" = "stop" ] && [ -d /sys/class/net/$IFACE/brif/$port ]; then + elif [ "$MODE" = "stop" -a "$PHASE" = "post-down" ] && [ -d /sys/class/net/$IFACE/brif/$port ]; then ip link set dev $port down && brctl delif $IFACE $port && destroy_vlan_port if [ -f /proc/sys/net/ipv6/conf/$port/disable_ipv6 ] then @@ -194,16 +198,15 @@ # Wait for the bridge to be ready if [ "$MAXWAIT" != 0 ] then - /bin/echo -e "\nWaiting for $IFACE to get ready (MAXWAIT is $MAXWAIT seconds)." - unset BREADY unset TRANSITIONED COUNT=0 + MMAXWAIT=$MAXWAIT # Use 0.1 delay if available - sleep 0.1 2>/dev/null && MAXWAIT=$((MAXWAIT * 10)) + sleep 0.1 2>/dev/null && MMAXWAIT=$((MAXWAIT * 10)) - while [ -n "$BREADY" -a $COUNT -lt $MAXWAIT ] + while [ ! "$BREADY" -a $COUNT -lt $MMAXWAIT ] do sleep 0.1 2>/dev/null || sleep 1 COUNT=$(($COUNT+1)) @@ -219,12 +222,15 @@ unset BREADY fi done + if [ -z "$BREADY" -a $COUNT = 1 ] + then + /bin/echo -e "\nWaiting for $IFACE to get ready (MAXWAIT is $MAXWAIT seconds)." + fi done - fi # Finally we destroy the interface -elif [ "$MODE" = "stop" ]; then +elif [ "$MODE" = "stop" -a "$PHASE" = "post-down" ]; then brctl delbr $IFACE