ntp_timer.c (ntp-4.2.8p14) | : | ntp_timer.c (ntp-4.2.8p15) | ||
---|---|---|---|---|
skipping to change at line 346 | skipping to change at line 346 | |||
#endif /* REFCLOCK */ | #endif /* REFCLOCK */ | |||
transmit(p); | transmit(p); | |||
} | } | |||
} | } | |||
/* | /* | |||
* Orphan mode is active when enabled and when no servers less | * Orphan mode is active when enabled and when no servers less | |||
* than the orphan stratum are available. A server with no other | * than the orphan stratum are available. A server with no other | |||
* synchronization source is an orphan. It shows offset zero and | * synchronization source is an orphan. It shows offset zero and | |||
* reference ID the loopback address. | * reference ID the loopback address. | |||
* | ||||
* [bug 3644] If the orphan stratum is >= STRATUM_UNSPEC, we | ||||
* have to do it a bit different. 'clock_select()' simply | ||||
* tiptoed home, but since we're unsync'd and have no peer, we | ||||
* should eventually declare we're out of sync. Otherwise we | ||||
* would persistently claim we're good, and we're everything but | ||||
* that... | ||||
* | ||||
* XXX: do we want to log an event about this? | ||||
*/ | */ | |||
if (sys_orphan < STRATUM_UNSPEC && sys_peer == NULL && | if (sys_peer == NULL && current_time > orphwait) { | |||
current_time > orphwait) { | if (sys_orphan < STRATUM_UNSPEC) { | |||
if (sys_leap == LEAP_NOTINSYNC) { | if (sys_leap == LEAP_NOTINSYNC) { | |||
set_sys_leap(LEAP_NOWARNING); | set_sys_leap(LEAP_NOWARNING); | |||
#ifdef AUTOKEY | #ifdef AUTOKEY | |||
if (crypto_flags) | if (crypto_flags) | |||
crypto_update(); | crypto_update(); | |||
#endif /* AUTOKEY */ | #endif /* AUTOKEY */ | |||
} | ||||
sys_stratum = (u_char)sys_orphan; | ||||
} else { | ||||
if (sys_leap != LEAP_NOTINSYNC) { | ||||
set_sys_leap(LEAP_NOTINSYNC); | ||||
msyslog(LOG_WARNING, "%s", | ||||
"no peer for too long, server running fre | ||||
e now"); | ||||
} | ||||
sys_stratum = STRATUM_UNSPEC; | ||||
} | } | |||
sys_stratum = (u_char)sys_orphan; | ||||
if (sys_stratum > 1) | if (sys_stratum > 1) | |||
sys_refid = htonl(LOOPBACKADR); | sys_refid = htonl(LOOPBACKADR); | |||
else | else | |||
memcpy(&sys_refid, "LOOP", 4); | memcpy(&sys_refid, "LOOP", 4); | |||
sys_offset = 0; | sys_offset = 0; | |||
sys_rootdelay = 0; | sys_rootdelay = 0; | |||
sys_rootdisp = 0; | sys_rootdisp = 0; | |||
} | } | |||
get_systime(&now); | get_systime(&now); | |||
time(&tnow); | time(&tnow); | |||
/* | /* | |||
* Leapseconds. Get time and defer to worker if either something | * Leapseconds. Get time and defer to worker if either something | |||
End of changes. 7 change blocks. | ||||
9 lines changed or deleted | 27 lines changed or added |