mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
network-hotplug-bridges: Apply STP_PRIORITY
Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
74e19a563c
commit
82973fae14
@@ -82,16 +82,22 @@ MODE="$(get_value "${ZONE}_MODE")"
|
|||||||
# The name of the virtual bridge
|
# The name of the virtual bridge
|
||||||
BRIDGE="$(get_value "${ZONE}_DEV")"
|
BRIDGE="$(get_value "${ZONE}_DEV")"
|
||||||
STP="$(get_value "${ZONE}_STP")"
|
STP="$(get_value "${ZONE}_STP")"
|
||||||
|
STP_PRIORITY="$(get_value "${ZONE}_STP_PRIORITY")"
|
||||||
|
|
||||||
case "${MODE}" in
|
case "${MODE}" in
|
||||||
bridge)
|
bridge)
|
||||||
|
# We need to check if $STP_PRIORITY has a valid value if not set it
|
||||||
|
if [ -n "${STP_PRIORITY}" ]; then
|
||||||
|
STP_PRIORITY=16384;
|
||||||
|
fi
|
||||||
|
|
||||||
ADDRESS="$(get_value "${ZONE}_MACADDR")"
|
ADDRESS="$(get_value "${ZONE}_MACADDR")"
|
||||||
[ -n "${ADDRESS}" ] || ADDRESS="$(random_mac_address)"
|
[ -n "${ADDRESS}" ] || ADDRESS="$(random_mac_address)"
|
||||||
|
|
||||||
# We need to create the bridge if it doesn't exist, yet
|
# We need to create the bridge if it doesn't exist, yet
|
||||||
if [ ! -d "/sys/class/net/${BRIDGE}" ]; then
|
if [ ! -d "/sys/class/net/${BRIDGE}" ]; then
|
||||||
ip link add "${BRIDGE}" address "${ADDRESS}" type bridge \
|
ip link add "${BRIDGE}" address "${ADDRESS}" type bridge \
|
||||||
$([ "${STP}" = "on" ] && echo "stp_state 1")
|
$([ "${STP}" = "on" ] && echo "stp_state 1 priority ${STP_PRIORITY}" )
|
||||||
#ip link set "${BRIDGE}" up
|
#ip link set "${BRIDGE}" up
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user