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 !

That looks more semantics (the ones I know of - dynamic interface scanning is one of my NTPd parts)

preserving now.

So far I see no other issues from the pitfalls I know of.

Lets hope our kernel and other SO_RERRORS systems miss any

interface scan worthy events.

Frank


On 01/03/21 12:03, Roy Marples wrote:
On 02/01/2021 23:33, Frank Kardel wrote:
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.

...

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

Valid points.

New patch sets disable_dynamic_updates if the -U 0 is given.
The only other code to touch disable_dynamic_updates is this
disable_dynamic_updates |= (sw_uid != 0); /* also notifies routing message listener *

So this should be good now.

diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/cmd_args.c
--- a/external/bsd/ntp/dist/ntpd/cmd_args.c Sat Jan 02 12:39:33 2021 +0000 +++ b/external/bsd/ntp/dist/ntpd/cmd_args.c Sun Jan 03 10:56:58 2021 +0000
@@ -181,9 +181,11 @@
        if (HAVE_OPT( UPDATEINTERVAL )) {
                long val = OPT_VALUE_UPDATEINTERVAL;

-               if (val >= 0)
+               if (val >= 0) {
                        interface_interval = val;
-               else {
+                       if (interface_interval == 0)
+                               disable_dynamic_updates = 1;
+               } else {
                        fprintf(stderr,
"command line interface update interval %ld must not be negative\n",
                                val);
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 Sun Jan 03 10:56:58 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 Sun Jan 03 10:56:58 2021 +0000
@@ -423,9 +423,11 @@
        /*
         * Interface update timer
         */
-       if (interface_interval && interface_timer <= current_time) {
-               timer_interfacetimeout(current_time +
-                   interface_interval);
+       if (!disable_dynamic_updates &&
+           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