From c6c93ebb24366ee5c5575084e85284957221b7d8 Mon Sep 17 00:00:00 2001 From: =?latin1?q?Fr=E9d=E9ric=20L=E9caille?= Date: Mon, 11 Feb 2019 16:02:25 +0100 Subject: network: replace brctl command iproute2 ones (ip link). Furthermore, there is no need to set the forward delay anymore when STP is not enabled to make the bridge forward. --- sbin/init.d/network | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/init.d/network b/sbin/init.d/network index d2fbad2..4e9d2f3 100755 --- a/sbin/init.d/network +++ b/sbin/init.d/network @@ -392,16 +392,16 @@ function do_start { # configure the bridge if [ ${#opt_bridge[*]} -gt 0 ]; then - brctl addbr $instname - [ "${opt_bridge_stp}" == "1" ] && brctl stp $instname on - [ "${opt_bridge_stp}" != "1" ] && brctl setfd $instname 0 + ip link add $instname type bridge + ip link set $instname up + [ "${opt_bridge_stp}" == "1" ] && echo 1 >/sys/class/net/$instname/bridge/stp_state for arg in ${opt_bridge[*]}; do if ! ( $0 status $arg || \ ip li set dev $arg up || \ $0 start $arg ) >/dev/null 2>&1; then echo " ==> FAILED! need to start iface $arg before $instname" else - brctl addif $instname $arg >/dev/null 2>&1 + ip link set dev $arg master $instname >/dev/null 2>&1 ip addr flush dev $arg >/dev/null 2>&1 fi done @@ -757,9 +757,9 @@ function do_stop { for arg in ${opt_bridge[*]}; do $0 status "$arg" && ip li set dev $arg down >/dev/null 2>&1 ip addr flush dev $arg >/dev/null 2>&1 - brctl delif $instname $arg >/dev/null 2>&1 + ip link set $arg nomaster >/dev/null 2>&1 done - brctl delbr $instname + ip link del $instname type bridge fi # delete tun/tap -- 2.28.0