From f353f8533397249d0bcef658a4e6fcd5fffdd856 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 17 Oct 2026 20:55:32 +0200 Subject: 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. --- src/helpers/vyos-load-balancer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3