|
1 Patch to restore the period refreshing of the interface list |
|
2 and to re-resolve the peers source addresses. This is needed |
|
3 because the interfaces are not done coming online when ntpd |
|
4 starts due to delays from DAD. |
|
5 |
|
6 This patch can be removed when NTP is upgraded to 4.2.7p396 |
|
7 or later |
|
8 |
|
9 |
|
10 --- ntpd/ntp_io.c |
|
11 +++ ntpd/ntp_io.c |
|
12 @@ -1704,7 +1704,6 @@ update_interfaces( |
|
13 isc_result_t result; |
|
14 isc_interface_t isc_if; |
|
15 int new_interface_found; |
|
16 - int refresh_peers; |
|
17 unsigned int family; |
|
18 endpt enumep; |
|
19 endpt * ep; |
|
20 @@ -1719,7 +1718,6 @@ update_interfaces( |
|
21 */ |
|
22 |
|
23 new_interface_found = FALSE; |
|
24 - refresh_peers = FALSE; |
|
25 iter = NULL; |
|
26 result = isc_interfaceiter_create(mctx, &iter); |
|
27 |
|
28 @@ -1755,6 +1753,8 @@ update_interfaces( |
|
29 |
|
30 convert_isc_if(&isc_if, &enumep, port); |
|
31 |
|
32 + DPRINT_INTERFACE(4, (&enumep, "examining ", "\n")); |
|
33 + |
|
34 /* |
|
35 * Check if and how we are going to use the interface. |
|
36 */ |
|
37 @@ -1762,19 +1762,23 @@ update_interfaces( |
|
38 enumep.flags)) { |
|
39 |
|
40 case ACTION_IGNORE: |
|
41 + DPRINTF(4, ("ignoring interface %s (%s) - by nic rules\n", |
|
42 + enumep.name, stoa(&enumep.sin))); |
|
43 continue; |
|
44 |
|
45 case ACTION_LISTEN: |
|
46 + DPRINTF(4, ("listen interface %s (%s) - by nic rules\n", |
|
47 + enumep.name, stoa(&enumep.sin))); |
|
48 enumep.ignore_packets = ISC_FALSE; |
|
49 break; |
|
50 |
|
51 case ACTION_DROP: |
|
52 + DPRINTF(4, ("drop on interface %s (%s) - by nic rules\n", |
|
53 + enumep.name, stoa(&enumep.sin))); |
|
54 enumep.ignore_packets = ISC_TRUE; |
|
55 break; |
|
56 } |
|
57 |
|
58 - DPRINT_INTERFACE(4, (&enumep, "examining ", "\n")); |
|
59 - |
|
60 /* interfaces must be UP to be usable */ |
|
61 if (!(enumep.flags & INT_UP)) { |
|
62 DPRINTF(4, ("skipping interface %s (%s) - DOWN\n", |
|
63 @@ -1817,15 +1821,7 @@ update_interfaces( |
|
64 */ |
|
65 strlcpy(ep->name, enumep.name, |
|
66 sizeof(ep->name)); |
|
67 - if (ep->ignore_packets != |
|
68 - enumep.ignore_packets) { |
|
69 - ep->ignore_packets = |
|
70 - enumep.ignore_packets; |
|
71 - refresh_peers = TRUE; |
|
72 - DPRINTF(4, ("refreshing peers due to %s ignore_packets change to %d\n", |
|
73 - stoa(&ep->sin), |
|
74 - ep->ignore_packets)); |
|
75 - } |
|
76 + ep->ignore_packets = enumep.ignore_packets; |
|
77 } else { |
|
78 /* name collision - rename interface */ |
|
79 strlcpy(ep->name, "*multiple*", |
|
80 @@ -1890,9 +1886,6 @@ update_interfaces( |
|
81 (*receiver)(data, &ifi); |
|
82 |
|
83 new_interface_found = TRUE; |
|
84 - refresh_peers = TRUE; |
|
85 - DPRINTF(4, ("refreshing peers due to new addr %s\n", |
|
86 - stoa(&ep->sin))); |
|
87 DPRINT_INTERFACE(3, |
|
88 (ep, "updating ", |
|
89 " new - created\n")); |
|
90 @@ -1932,9 +1925,6 @@ update_interfaces( |
|
91 DPRINT_INTERFACE(3, (ep, "updating ", |
|
92 "GONE - deleting\n")); |
|
93 remove_interface(ep); |
|
94 - refresh_peers = TRUE; |
|
95 - DPRINTF(4, ("refreshing peers due to deleted addr %s\n", |
|
96 - stoa(&ep->sin))); |
|
97 |
|
98 ifi.action = IFS_DELETED; |
|
99 ifi.ep = ep; |
|
100 @@ -1956,17 +1946,16 @@ update_interfaces( |
|
101 } |
|
102 |
|
103 /* |
|
104 - * phase 3 - re-configure as the world has changed if necessary |
|
105 + * phase 3 - re-configure as the world has probably changed |
|
106 + * |
|
107 + * never ever make this conditional again - it is needed to track |
|
108 + * routing updates. see bug #2506 |
|
109 */ |
|
110 + refresh_all_peerinterfaces(); |
|
111 |
|
112 if (broadcast_client_enabled) |
|
113 io_setbclient(); |
|
114 |
|
115 - if (refresh_peers) { |
|
116 - refresh_all_peerinterfaces(); |
|
117 - msyslog(LOG_INFO, "peers refreshed"); |
|
118 - } |
|
119 - |
|
120 return new_interface_found; |
|
121 } |
|
122 |