mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
map-agent: traffic_separation: do network restart if vid mapping is incorrect on reload
This commit is contained in:
parent
fbeaed38a1
commit
05938b6ddd
1 changed files with 35 additions and 2 deletions
|
|
@ -167,7 +167,7 @@ EOF
|
|||
|
||||
ts_reload() {
|
||||
local dhcp_reload=$1
|
||||
|
||||
restart=""
|
||||
# workaround for missing backhaul wifi.ap.* ubus obj's:
|
||||
# iterate in config and setup bh
|
||||
# config_load wireless
|
||||
|
|
@ -188,8 +188,41 @@ EOF
|
|||
|
||||
# config_foreach _setup_bh_iface wifi-iface
|
||||
|
||||
bridge_verify_vid_mapping() {
|
||||
local section=$1
|
||||
|
||||
check__port_vid() {
|
||||
local port="$1"
|
||||
local vlan="$2"
|
||||
|
||||
added=$(bridge vlan show dev $port | grep -w "$vlan")
|
||||
if [ "$added" = "" ]; then
|
||||
restart="1"
|
||||
break
|
||||
fi
|
||||
}
|
||||
|
||||
config_get vlan "$section" vlan "0"
|
||||
|
||||
[ "$vlan" = "0" ] && continue
|
||||
|
||||
config_list_foreach "$section" "ports" check_port_vid "$vlan"
|
||||
[ "$restart" = "1" ] && break
|
||||
}
|
||||
|
||||
|
||||
|
||||
config_load network
|
||||
config_foreach bridge_verify_vid_mapping bridge-vlan
|
||||
|
||||
|
||||
[ -n "dhcp_reload" ] && /etc/init.d/dnsmasq reload
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
if [ "$restart" = "1" ]; then
|
||||
dbg "trigger network restart"
|
||||
/etc/init.d/network restart
|
||||
else
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
fi
|
||||
/etc/init.d/firewall reload
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue