Compare commits

...

1 Commits

Author SHA1 Message Date
Jakob Olsson
0d1e06ec6c map-agent: prints to debug invalid backhaul set 2022-07-15 12:46:21 +02:00
2 changed files with 5 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=2.9.0.4
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=6b3db98e4ff39f13daf41e3e8247947a4934f6cb
PKG_SOURCE_VERSION:=4f06e11fc17f6c462960cbd8a9835b5a16b53e9c
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause

View File

@@ -864,6 +864,8 @@ set_uplink() {
config_load mapagent
ubus send map.agent '{"action":"unset", "type":"'$type'", "ifname":"'$ifname'", "macaddr":"'$hwaddr'"}'
island_prevention="$(uci -q get mapagent.agent.island_prevention)"
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
@@ -883,11 +885,13 @@ unset_uplink() {
ubus call map.agent toggle_fh '{"enable":false, "prevent_island":true, "ifname":"all"}'
fi
(
flock -x 200
json_load "$(cat $MAPFILE)"
json_get_var bk_type type
json_cleanup
ubus send map.agent '{"action":"unset", "type":"'$type'", "bk_type":"'$bk_type'"}'
[ "$type" = "$bk_type" ] && rm -f "$MAPFILE" > /dev/null 2>&1
) 200>/var/lock/map.backhaul.lock