Blame SOURCES/ntp-4.2.6p5-refreshroute.patch

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