diff --git a/clock.c b/clock.c index 82692bc..b0e65a5 100644 --- a/clock.c +++ b/clock.c @@ -70,6 +70,7 @@ struct clock { tmv_t path_delay; struct mave *avg_delay; struct freq_estimator fest; + double nrr; tmv_t c1; tmv_t c2; tmv_t t1; @@ -685,9 +686,10 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx, pr_debug("path delay %10lld %10lld", c->path_delay, pd); } -void clock_peer_delay(struct clock *c, tmv_t ppd) +void clock_peer_delay(struct clock *c, tmv_t ppd, double nrr) { c->path_delay = ppd; + c->nrr = nrr; } void clock_remove_fda(struct clock *c, struct port *p, struct fdarray fda) diff --git a/clock.h b/clock.h index 56eac92..c801da7 100644 --- a/clock.h +++ b/clock.h @@ -142,8 +142,9 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx, * Provide the estimated peer delay from a slave port. * @param c The clock instance. * @param ppd The peer delay as measured on a slave port. + * @param nrr The neighbor rate ratio as measured on a slave port. */ -void clock_peer_delay(struct clock *c, tmv_t ppd); +void clock_peer_delay(struct clock *c, tmv_t ppd, double nrr); /** * Poll for events and dispatch them. diff --git a/port.c b/port.c index 0ff5a73..4c3cc52 100644 --- a/port.c +++ b/port.c @@ -1183,7 +1183,7 @@ calc: port_nrate_calculate(p, t3, t4, tmv_add(c1, c2)); if (p->state == PS_UNCALIBRATED || p->state == PS_SLAVE) { - clock_peer_delay(p->clock, p->peer_delay); + clock_peer_delay(p->clock, p->peer_delay, p->nrate.ratio); } }