Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/external/bsd/ntp/dist/ntpd



Hi Roy !

This may look like a better solution from the interface tracking side.

People have requested being able to disable dynamic interface updates completely.

This was implemented via the -U 0.

See man ntpd:

...

    −U number, −−updateinterval=number
interval in seconds between scans for new or dropped inter‐ faces. This option takes an integer number as its argument.

Give the time in seconds between two scans for new or dropped
                 interfaces.  For systems with routing socket support the
                 scans will be performed shortly after the interface change
has been detected by the system. Use 0 to disable scanning.
                 60 seconds is the minimum time between scans.

...

This patch seems (by visual inspection) to break that logic.

Also the behavior now fully relies in the routing message functionality which can be disabled

on serious procession errors - at that point the code robustness relies on the periodic

re-scanning - so I am not sure whether the periodic re-scanning should be completely

disabled.

Best regards,

  Frank


On 01/02/21 19:41, Roy Marples wrote:
On 02/01/2021 17:23, Roy Marples wrote:
That's a good point, with this we can now remove that forced sync on a timer approach.

Does this look ok?

Better patch:

diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/ntp_io.c
--- a/external/bsd/ntp/dist/ntpd/ntp_io.c Sat Jan 02 12:39:33 2021 +0000 +++ b/external/bsd/ntp/dist/ntpd/ntp_io.c Sat Jan 02 18:39:34 2021 +0000
@@ -455,8 +455,13 @@
 {
        /* Init buffer free list and stat counters */
        init_recvbuff(RECV_INIT);
+#ifdef SO_RERROR
+       /* route(4) overflow can be observed */
+       interface_interval = 0;
+#else
        /* update interface every 5 minutes as default */
        interface_interval = 300;
+#endif

 #ifdef WORK_PIPE
        addremove_io_fd = &ntpd_addremove_io_fd;
diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/ntp_timer.c
--- a/external/bsd/ntp/dist/ntpd/ntp_timer.c Sat Jan 02 12:39:33 2021 +0000 +++ b/external/bsd/ntp/dist/ntpd/ntp_timer.c Sat Jan 02 18:39:34 2021 +0000
@@ -423,9 +423,10 @@
        /*
         * Interface update timer
         */
-       if (interface_interval && interface_timer <= current_time) {
-               timer_interfacetimeout(current_time +
-                   interface_interval);
+       if (interface_timer && interface_timer <= current_time) {
+               if (interface_interval)
+                       timer_interfacetimeout(current_time +
+                           interface_interval);
                DPRINTF(2, ("timer: interface update\n"));
                interface_update(NULL, NULL);
        }



Home | Main Index | Thread Index | Old Index