netifd: (APP-2648, PR #206) only reconfigure switch if changes

This avoids our ethernet link dropping on any network change. It's a quick and dirty patch so we have minimal code here.

Approved-by: Arien Judge
Approved-by: Evan Benn
This commit is contained in:
James Haggerty 2024-03-12 00:05:25 +00:00 committed by Arien Judge
parent b5fa3591c7
commit 3b0959bb87

View file

@ -10,6 +10,7 @@ init_switch() {
include /lib/network
setup_switch
uci show network | grep '^network.@switch' > /var/swconfig.current
}
start_service() {
@ -28,7 +29,9 @@ start_service() {
reload_service() {
local rv=0
init_switch
if ! uci show network | grep '^network.@switch' | cmp -s /var/swconfig.current; then
init_switch
fi
ubus call network reload || rv=1
/sbin/wifi reload_legacy
return $rv