]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ChangeLog:
authorFrank Kardel <kardel@ntp.org>
Mon, 18 Nov 2013 20:55:37 +0000 (20:55 +0000)
committerFrank Kardel <kardel@ntp.org>
Mon, 18 Nov 2013 20:55:37 +0000 (20:55 +0000)
ntp_io.c:
  [Bug 2506] make sure routing updates are always tracked
  the 'flapping fix' from 2010-12-12 was and is incorrect
  as routes can change without change of interface
  configuration.

bk: 528a7ec9dnLwlwUsSqVSTRcbKXJ13A

ChangeLog
ntpd/ntp_io.c

index e1d4267a28e06bf3e39efd51d989956e1656ec1a..acfdb5042e208f9d0042c47cc5db943e8dfe2d14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 2506] make sure routing updates are always tracked
 (4.2.7p395) 2013/11/12 Released by Harlan Stenn <stenn@ntp.org>
 * Upgrade to autogen-5.18.3pre5 and libopts-40.1.15.
 (4.2.7p394) 2013/11/05 Released by Harlan Stenn <stenn@ntp.org>
index c5701d294a5ebd17b54e86da8edff39a687cbab2..c25e39777083a271588092002cde8c6ef87db346 100644 (file)
@@ -1704,7 +1704,6 @@ update_interfaces(
        isc_result_t            result;
        isc_interface_t         isc_if;
        int                     new_interface_found;
-       int                     refresh_peers;
        unsigned int            family;
        endpt                   enumep;
        endpt *                 ep;
@@ -1719,7 +1718,6 @@ update_interfaces(
         */
 
        new_interface_found = FALSE;
-       refresh_peers = FALSE;
        iter = NULL;
        result = isc_interfaceiter_create(mctx, &iter);
 
@@ -1755,6 +1753,8 @@ update_interfaces(
 
                convert_isc_if(&isc_if, &enumep, port);
 
+               DPRINT_INTERFACE(4, (&enumep, "examining ", "\n"));
+
                /* 
                 * Check if and how we are going to use the interface.
                 */
@@ -1762,19 +1762,23 @@ update_interfaces(
                                         enumep.flags)) {
 
                case ACTION_IGNORE:
+                       DPRINTF(4, ("ignoring interface %s (%s) - by nic rules\n",
+                                   enumep.name, stoa(&enumep.sin)));
                        continue;
 
                case ACTION_LISTEN:
+                       DPRINTF(4, ("listen interface %s (%s) - by nic rules\n",
+                                   enumep.name, stoa(&enumep.sin)));
                        enumep.ignore_packets = ISC_FALSE;
                        break;
 
                case ACTION_DROP:
+                       DPRINTF(4, ("drop on interface %s (%s) - by nic rules\n",
+                                   enumep.name, stoa(&enumep.sin)));
                        enumep.ignore_packets = ISC_TRUE;
                        break;
                }
 
-               DPRINT_INTERFACE(4, (&enumep, "examining ", "\n"));
-
                 /* interfaces must be UP to be usable */
                if (!(enumep.flags & INT_UP)) {
                        DPRINTF(4, ("skipping interface %s (%s) - DOWN\n",
@@ -1817,15 +1821,8 @@ update_interfaces(
                                 */
                                strlcpy(ep->name, enumep.name,
                                        sizeof(ep->name));
-                               if (ep->ignore_packets !=
-                                   enumep.ignore_packets) {
-                                       ep->ignore_packets = 
+                               ep->ignore_packets = 
                                            enumep.ignore_packets;
-                                       refresh_peers = TRUE;
-                                       DPRINTF(4, ("refreshing peers due to %s ignore_packets change to %d\n",
-                                           stoa(&ep->sin),
-                                           ep->ignore_packets));
-                               }
                        } else {
                                /* name collision - rename interface */
                                strlcpy(ep->name, "*multiple*",
@@ -1890,9 +1887,6 @@ update_interfaces(
                                        (*receiver)(data, &ifi);
 
                                new_interface_found = TRUE;
-                               refresh_peers = TRUE;
-                               DPRINTF(4, ("refreshing peers due to new addr %s\n",
-                                       stoa(&ep->sin)));
                                DPRINT_INTERFACE(3,
                                        (ep, "updating ",
                                         " new - created\n"));
@@ -1932,9 +1926,6 @@ update_interfaces(
                DPRINT_INTERFACE(3, (ep, "updating ",
                                     "GONE - deleting\n"));
                remove_interface(ep);
-               refresh_peers = TRUE;
-               DPRINTF(4, ("refreshing peers due to deleted addr %s\n",
-                           stoa(&ep->sin)));
 
                ifi.action = IFS_DELETED;
                ifi.ep = ep;
@@ -1956,16 +1947,15 @@ update_interfaces(
        }
 
        /*
-        * phase 3 - re-configure as the world has changed if necessary
+        * phase 3 - re-configure as the world has possibly changed
+        *
+        * never ever make this conditional again - it is needed to track
+        * routing updates. see bug #2506
         */
+       refresh_all_peerinterfaces();
 
        if (broadcast_client_enabled)
                io_setbclient();
-       
-       if (refresh_peers) {
-               refresh_all_peerinterfaces();
-               msyslog(LOG_INFO, "peers refreshed");
-       }
 
        return new_interface_found;
 }