odhcp6c: sync and accumulate RA & DHCPv6 events as fast as possible
authorAlin Nastac <[email protected]>
Wed, 3 Jan 2024 14:59:55 +0000 (15:59 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 14 Oct 2025 06:29:12 +0000 (08:29 +0200)
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 <[email protected]>
Link: https://github.com/openwrt/odhcp6c/pull/82
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/odhcp6c.c

index 20b4040a17d45b46824bcbd67a06a7028686521a..30bf78f29b87d57bab3ea9f72b1082cb1245d249 100644 (file)
@@ -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) {