Skip to content

Commit

Permalink
busybox: ntpd: more verbose message for "root distance too high" case…
Browse files Browse the repository at this point in the history
… (backport)

Original commit: 1303962957fb900ed97c5958403990e885b06e29
  • Loading branch information
Denys Vlasenko authored and RMerl committed May 13, 2019
1 parent 2091dd6 commit 0faeab4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions release/src/router/busybox/networking/ntpd.c
Expand Up @@ -1094,7 +1094,8 @@ fit(peer_t *p, double rd)
{ {
if ((p->reachable_bits & (p->reachable_bits-1)) == 0) { if ((p->reachable_bits & (p->reachable_bits-1)) == 0) {
/* One or zero bits in reachable_bits */ /* One or zero bits in reachable_bits */
VERB4 bb_error_msg("peer %s unfit for selection: unreachable", p->p_dotted); VERB4 bb_error_msg("peer %s unfit for selection: "
"unreachable", p->p_dotted);
return 0; return 0;
} }
if (option_mask32 & OPT_t) /* RFC-4330 check disabled */ if (option_mask32 & OPT_t) /* RFC-4330 check disabled */
Expand All @@ -1104,13 +1105,17 @@ fit(peer_t *p, double rd)
if ((p->lastpkt_status & LI_ALARM) == LI_ALARM if ((p->lastpkt_status & LI_ALARM) == LI_ALARM
|| p->lastpkt_stratum >= MAXSTRAT || p->lastpkt_stratum >= MAXSTRAT
) { ) {
VERB4 bb_error_msg("peer %s unfit for selection: bad status/stratum", p->p_dotted); VERB4 bb_error_msg("peer %s unfit for selection: "
"bad status/stratum", p->p_dotted);
return 0; return 0;
} }
#endif #endif
/* rd is root_distance(p) */ /* rd is root_distance(p) */
if (rd > MAXDIST + FREQ_TOLERANCE * (1 << G.poll_exp)) { if (rd > MAXDIST + FREQ_TOLERANCE * (1 << G.poll_exp)) {
VERB4 bb_error_msg("peer %s unfit for selection: root distance too high", p->p_dotted); VERB3 bb_error_msg("peer %s unfit for selection: "
"root distance %f too high, jitter:%f",
p->p_dotted, rd, p->filter_jitter
);
return 0; return 0;
} }
//TODO //TODO
Expand Down

0 comments on commit 0faeab4

Please sign in to comment.