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