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 Frank

On 02/01/2021 09:55, Frank Kardel wrote:
I doubt that the explicit draining is helpful here as it already happens

I was aware of that.
I was just trying to avoid excess timer interface timeouts if we don't get around to reading the next message in UPDATE_GRACE time.
Let's see what upstream says.

Also the ntp_io system will periodically refresh it interface lists in time as it was explicitly designed to be robust against lost messages from the routing socket.

That's a good point, with this we can now remove that forced sync on a timer approach.

Does this look ok?

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 17:19:28 2021 +0000
@@ -423,9 +423,18 @@
        /*
         * Interface update timer
         */
-       if (interface_interval && interface_timer <= current_time) {
-               timer_interfacetimeout(current_time +
-                   interface_interval);
+       if (interface_timer && interface_timer <= current_time) {
+#ifdef SO_RERROR
+               /*
+                * Because we can catch route(4) overflow, there is no
+                * need to update interfaces every interface_interval.
+                */
+               interface_timer = 0;
+#else
+               if (interface_interval)
+                       timer_interfacetimeout(current_time +
+                           interface_interval);
+#endif
                DPRINTF(2, ("timer: interface update\n"));
                interface_update(NULL, NULL);
        }

We should try to keep the differences to the up-stream code as little as possible. Especially when the upstream code already handles the situation reasonably the is no need for additional code.

Agreed.
I already submitted the diff upstream, but will adjust it to remove the forced refresh.

Happy new year!

And the same to you!

Roy


Home | Main Index | Thread Index | Old Index