map-agent: activate dynamic-backhaul handling only if device is operating in extender mode

if AL bridge network uses DHCP as protocol, assume it is extender mode
This commit is contained in:
Sukru Senli 2023-07-27 15:09:13 +02:00 committed by Jakob Olsson
parent 89af5bba92
commit 01f98c52c9
2 changed files with 13 additions and 3 deletions

View file

@ -11,6 +11,9 @@ al_brnet="${al_bridge:3}"
# Exit if the PORT is not member of the AL Bridge
[ "$(get_network_of $PORT)" = "$al_brnet" ] || exit 0
# Exit if the device is not operating in extender/repeater mode
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
############## Dynamic Backhaul Daemon ##############
if [ -n "$(which dynbhd)" ]; then
pidof dynbhd >/dev/null && exit 0 # dynbhd is managing the links
@ -47,8 +50,6 @@ if [ -n "$wanport" ]; then
########################################################
else
#################### DHCP Discovery ####################
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
if [ "$LINK" = "up" ]; then
brctl delif $al_bridge $PORT

View file

@ -179,7 +179,16 @@ create_dir() {
}
start_service() {
[ -f /usr/sbin/dynbhd ] && start_dynbhd_service
if [ -f /usr/sbin/dynbhd ]; then
# Start dynbhd only if the device is operating in extender/repeater mode
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
if [ "${al_bridge:0:3}" = "br-" ]; then
al_brnet="${al_bridge:3}"
if [ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ]; then
start_dynbhd_service
fi
fi
fi
config_load "mapagent"
validate_agent_config || return 1;