From 20c66d6499f22adad6c1dae854a627f061c5fbcb Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Wed, 24 Jul 2013 10:57:48 +0200 Subject: Use iproute2 for bridging (FS#36165) This sheds the dependency on the old bridge-utils (brctl). --- src/lib/connections/bridge | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/lib/connections/bridge') diff --git a/src/lib/connections/bridge b/src/lib/connections/bridge index 94a9b64..3b0a94b 100644 --- a/src/lib/connections/bridge +++ b/src/lib/connections/bridge @@ -2,7 +2,6 @@ . "$SUBR_DIR/ip" -: ${BRCTL:=brctl} declare -ag BindsToInterfaces bridge_up() { @@ -12,17 +11,17 @@ bridge_up() { return 1 fi else - $BRCTL addbr "$Interface" + ip link add name "$Interface" type bridge fi for member in "${BindsToInterfaces[@]}"; do - ip link set "$member" promisc on up - ip addr flush dev "$member" - $BRCTL addif "$Interface" "$member" + ip link set dev "$member" promisc on up + ip addr flush dev "$member" scope host &>/dev/null + ip addr flush dev "$member" scope site &>/dev/null + ip addr flush dev "$member" scope global &>/dev/null + ip link set dev "member" master "$Interface" + is_yes "${SkipForwardingDelay:-no}" && bridge link set dev "$member" state 3 done - # Set options - [[ "$FwdDelay" ]] && $BRCTL setfd "$Interface" "$FwdDelay" - [[ "$MaxAge" ]] && $BRCTL setmaxage "$Interface" "$MaxAge" bring_interface_up "$Interface" ip_set @@ -31,12 +30,12 @@ bridge_up() { bridge_down() { for member in "${BindsToInterfaces[@]}"; do ip link set "$member" promisc off down - $BRCTL delif "$Interface" "$member" + ip link set dev "$member" nomaster done ip_unset bring_interface_down "$Interface" - $BRCTL delbr "$Interface" + ip link delete "$Interface" type bridge } -- cgit v1.2.3-24-g4f1b