From: Alin Nastac Date: Wed, 3 Jan 2024 14:59:55 +0000 (+0100) Subject: odhcp6c: sync and accumulate RA & DHCPv6 events as fast as possible X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=6ca1552cb3fe1a50153d8c2bfa4067513afcdd6b;p=project%2Fodhcp6c.git odhcp6c: sync and accumulate RA & DHCPv6 events as fast as possible This fixes commit dc186d6d2b0d which introduced accumulation delay differences between the 2 possible scenarios: 1. When DHCPv6 bound event precede RA receival, sync script is called after 1 second since accumulation has been completed (i.e. RA has been received). 2. When RA receival precedes DHCPv6 bound event, sync script is called after a delay of 10 seconds since accumulation is done. Fixes: dc186d6d2b0d ("odhcp6c: sync and accumulate RA & DHCPv6 events correctly") Signed-off-by: Alin Nastac Link: https://github.com/openwrt/odhcp6c/pull/82 Signed-off-by: Álvaro Fernández Rojas --- diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 20b4040..30bf78f 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -512,7 +512,7 @@ int main(_unused int argc, char* const argv[]) while (!signal_usr2 && !signal_term) { signal_usr1 = false; - script_call("informed", script_sync_delay, true); + script_call("informed", ra ? script_accu_delay : script_sync_delay, true); res = dhcpv6_poll_reconfigure(); odhcp6c_signal_process(); @@ -540,7 +540,7 @@ int main(_unused int argc, char* const argv[]) case DHCPV6_STATEFUL: bound = true; - script_call("bound", script_sync_delay, true); + script_call("bound", ra ? script_accu_delay : script_sync_delay, true); syslog(LOG_NOTICE, "entering stateful-mode on %s", ifname); while (!signal_usr2 && !signal_term) {