summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-17 20:55:32 +0200
committerChristian Breunig <christian@breunig.cc>2026-10-17 20:56:35 +0200
commitf353f8533397249d0bcef658a4e6fcd5fffdd856 (patch)
tree802e814ba2e01f73f7643cb0a129dcc3e3b0ea32 /src
parentbd8be7c142269bbe3849ab70e8e26bc2077e3f9b (diff)
downloadvyos-1x-f353f8533397249d0bcef658a4e6fcd5fffdd856.tar.gz
vyos-1x-f353f8533397249d0bcef658a4e6fcd5fffdd856.zip
wlb: T9472: report the initial state of every interface
On start the health daemon forces a state change so the hook learns the initial state of the WAN interfaces. The flag doing so was reset after the first interface, every other interface was only reported once its state actually changed. The flag is now reset after all interfaces have been checked. The existing hook smoketest relied on the old behaviour: it now keeps all hook events and no longer reads a file left over from an earlier run.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/helpers/vyos-load-balancer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/helpers/vyos-load-balancer.py b/src/helpers/vyos-load-balancer.py
index d289f1c7f..38ba8d87b 100755
--- a/src/helpers/vyos-load-balancer.py
+++ b/src/helpers/vyos-load-balancer.py
@@ -375,7 +375,6 @@ if __name__ == '__main__':
#Force state changed to trigger the first write
if init == True:
state['state_changed'] = True
- init = False
if state['state_changed']:
state['if_addr'] = get_ipv4_address(ifname)
@@ -386,6 +385,9 @@ if __name__ == '__main__':
restore_default_route(lb, ifname)
+ # every interface reports its initial state
+ init = False
+
if any(state['state_changed'] for ifname, state in lb['health_state'].items()):
if not nftables_update(lb):
break