Blame SOURCES/ntp-4.2.6p5-refreshroute.patch

6e16f6
Backported from ntp-dev-4.2.7p399
6e16f6
6e16f6
diff -up ntp-4.2.6p5/ntpd/ntp_io.c.refreshroute ntp-4.2.6p5/ntpd/ntp_io.c
6e16f6
--- ntp-4.2.6p5/ntpd/ntp_io.c.refreshroute	2013-10-17 13:48:34.808727175 +0200
6e16f6
+++ ntp-4.2.6p5/ntpd/ntp_io.c	2013-12-09 14:02:28.076249785 +0100
6e16f6
@@ -1785,7 +1785,6 @@ update_interfaces(
6e16f6
 	isc_result_t		result;
6e16f6
 	isc_interface_t		isc_if;
6e16f6
 	int			new_interface_found;
6e16f6
-	int			refresh_peers;
6e16f6
 	unsigned int		family;
6e16f6
 	endpt			enumep;
6e16f6
 	endpt *			ep;
6e16f6
@@ -1800,7 +1799,6 @@ update_interfaces(
6e16f6
 	 */
6e16f6
 
6e16f6
 	new_interface_found = FALSE;
6e16f6
-	refresh_peers = FALSE;
6e16f6
 	iter = NULL;
6e16f6
 	result = isc_interfaceiter_create(mctx, &iter);
6e16f6
 
6e16f6
@@ -1836,6 +1834,8 @@ update_interfaces(
6e16f6
 
6e16f6
 		convert_isc_if(&isc_if, &enumep, port);
6e16f6
 
6e16f6
+		DPRINT_INTERFACE(4, (&enumep, "examining ", "\n"));
6e16f6
+
6e16f6
 		/* 
6e16f6
 		 * Check if and how we are going to use the interface.
6e16f6
 		 */
6e16f6
@@ -1843,19 +1843,23 @@ update_interfaces(
6e16f6
 					 enumep.flags)) {
6e16f6
 
6e16f6
 		case ACTION_IGNORE:
6e16f6
+			DPRINTF(4, ("ignoring interface %s (%s) - by nic rules\n",
6e16f6
+				    enumep.name, stoa(&enumep.sin)));
6e16f6
 			continue;
6e16f6
 
6e16f6
 		case ACTION_LISTEN:
6e16f6
+			DPRINTF(4, ("listen interface %s (%s) - by nic rules\n",
6e16f6
+				    enumep.name, stoa(&enumep.sin)));
6e16f6
 			enumep.ignore_packets = ISC_FALSE;
6e16f6
 			break;
6e16f6
 
6e16f6
 		case ACTION_DROP:
6e16f6
+			DPRINTF(4, ("drop on interface %s (%s) - by nic rules\n",
6e16f6
+				    enumep.name, stoa(&enumep.sin)));
6e16f6
 			enumep.ignore_packets = ISC_TRUE;
6e16f6
 			break;
6e16f6
 		}
6e16f6
 
6e16f6
-		DPRINT_INTERFACE(4, (&enumep, "examining ", "\n"));
6e16f6
-
6e16f6
 		 /* interfaces must be UP to be usable */
6e16f6
 		if (!(enumep.flags & INT_UP)) {
6e16f6
 			DPRINTF(4, ("skipping interface %s (%s) - DOWN\n",
6e16f6
@@ -1898,15 +1902,8 @@ update_interfaces(
6e16f6
 				 */
6e16f6
 				strncpy(ep->name, enumep.name,
6e16f6
 					sizeof(ep->name));
6e16f6
-				if (ep->ignore_packets !=
6e16f6
-				    enumep.ignore_packets) {
6e16f6
-					ep->ignore_packets = 
6e16f6
+				ep->ignore_packets = 
6e16f6
 					    enumep.ignore_packets;
6e16f6
-					refresh_peers = TRUE;
6e16f6
-					DPRINTF(4, ("refreshing peers due to %s ignore_packets change to %d\n",
6e16f6
-					    stoa(&ep->sin),
6e16f6
-					    ep->ignore_packets));
6e16f6
-				}
6e16f6
 			} else {
6e16f6
 				/* name collision - rename interface */
6e16f6
 				strncpy(ep->name, "*multiple*",
6e16f6
@@ -1971,9 +1968,6 @@ update_interfaces(
6e16f6
 					(*receiver)(data, &ifi;;
6e16f6
 
6e16f6
 				new_interface_found = TRUE;
6e16f6
-				refresh_peers = TRUE;
6e16f6
-				DPRINTF(4, ("refreshing peers due to new addr %s\n",
6e16f6
-					stoa(&ep->sin)));
6e16f6
 				DPRINT_INTERFACE(3,
6e16f6
 					(ep, "updating ",
6e16f6
 					 " new - created\n"));
6e16f6
@@ -2013,9 +2007,6 @@ update_interfaces(
6e16f6
 		DPRINT_INTERFACE(3, (ep, "updating ",
6e16f6
 				     "GONE - deleting\n"));
6e16f6
 		remove_interface(ep);
6e16f6
-		refresh_peers = TRUE;
6e16f6
-		DPRINTF(4, ("refreshing peers due to deleted addr %s",
6e16f6
-			    stoa(&ep->sin)));
6e16f6
 
6e16f6
 		ifi.action = IFS_DELETED;
6e16f6
 		ifi.ep = ep;
6e16f6
@@ -2037,12 +2028,12 @@ update_interfaces(
6e16f6
 	}
6e16f6
 
6e16f6
 	/*
6e16f6
-	 * phase 3 - re-configure as the world has changed if necessary
6e16f6
+	 * phase 3 - re-configure as the world has possibly changed
6e16f6
+	 *
6e16f6
+	 * never ever make this conditional again - it is needed to track
6e16f6
+	 * routing updates. see bug #2506
6e16f6
 	 */
6e16f6
-	if (refresh_peers) {
6e16f6
-		refresh_all_peerinterfaces();
6e16f6
-		msyslog(LOG_INFO, "peers refreshed");
6e16f6
-	}
6e16f6
+	refresh_all_peerinterfaces();
6e16f6
 
6e16f6
 	if (sys_bclient)
6e16f6
 		io_setbclient();