author | John Beck <John.Beck@Oracle.COM> |
Tue, 20 Oct 2015 18:38:49 -0700 | |
changeset 4985 | eed3576cafd0 |
parent 4486 | 8a12763ec19a |
permissions | -rw-r--r-- |
4486
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
1 |
Don't change interfaces unless there is something wrong with the old one. |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
2 |
This is NTP bug [2043] and this patch should be removed after upgrading to |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
3 |
a version of NTP with a fix for that bug. |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
4 |
|
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
5 |
--- ntpd/ntp_peer.c |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
6 |
+++ ntpd/ntp_peer.c |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
7 |
@@ -718,9 +718,13 @@ |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
8 |
/* |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
9 |
* this is called when the interface list has changed |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
10 |
* give all peers a chance to find a better interface |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
11 |
+ * but only if either they don't have an address already |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
12 |
+ * or if the one they have hasn't worked for a while. |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
13 |
*/ |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
14 |
- for (p = peer_list; p != NULL; p = p->p_link) |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
15 |
- peer_refresh_interface(p); |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
16 |
+ for (p = peer_list; p != NULL; p = p->p_link) { |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
17 |
+ if (!(p->dstadr && (p->reach & 0x3))) |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
18 |
+ peer_refresh_interface(p); |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
19 |
+ } |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
20 |
} |
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
21 |
|
8a12763ec19a
PSARC 2015/278 NTP allow_step_at_boot
Brian Utterback <brian.utterback@oracle.com>
parents:
diff
changeset
|
22 |