map-agent: handle link loss of eth when active bh

This commit is contained in:
Filip Matusiak 2022-04-01 15:20:26 +00:00 committed by Jakob Olsson
parent 0166ee6540
commit 96b7aad9f2
2 changed files with 18 additions and 11 deletions

View file

@ -97,7 +97,9 @@ if [ "$LINK" = "up" ]; then
/lib/wifi/multiap set_uplink "eth" "$PORT"
else
rm -f "$map_bh_file"
/lib/wifi/multiap unset_uplink "eth"
#rm -f "$map_bh_file"
config_load "mapagent"
config_foreach update_bstas bsta up
fi

View file

@ -797,21 +797,26 @@ set_uplink() {
config_load mapagent
mapagent_process_agent() {
local section=$1
island_prevention="$(uci -q get mapagent.agent.island_prevention)"
config_get island_prevention $section island_prevention
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
ubus call map.agent toggle_fh '{"enable":true, "prevent_island":true, "ifname":"all"}'
fi
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
ubus call map.agent toggle_fh '{"ifname":"all", "enable":true}'
fi
}
config_foreach mapagent_process_agent agent
}
unset_uplink() {
rm "$MAPFILE" > /dev/null 2>&1
local type=${1:-wifi}
config_load mapagent
island_prevention="$(uci -q get mapagent.agent.island_prevention)"
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
ubus call map.agent toggle_fh '{"enable":false, "prevent_island":true, "ifname":"all"}'
fi
rm -f "$MAPFILE" > /dev/null 2>&1
}
func=$1