summaryrefslogtreecommitdiffstats
path: root/src/neigh.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/neigh.c')
-rw-r--r--src/neigh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/neigh.c b/src/neigh.c
index 0270192..bffbaa4 100644
--- a/src/neigh.c
+++ b/src/neigh.c
@@ -68,7 +68,7 @@ uint16_t gp_babel_neigh_get_rxcost(gmrf_context_t *ctx, const gp_babel_neigh_t *
if (!neigh->hello_log || !neigh->hello_interval || !neigh->iface)
return GP_BABEL_INFINITY;
- int timediff = (gmrf_now(ctx->gmrf) - neigh->last_hello)/10;
+ int timediff = gp_babel_since(ctx, neigh->last_hello);
int shift = (timediff - neigh->hello_interval/2)/neigh->hello_interval;
if (shift >= 16)
@@ -83,7 +83,7 @@ uint16_t gp_babel_neigh_get_rxcost(gmrf_context_t *ctx, const gp_babel_neigh_t *
}
uint16_t gp_babel_neigh_get_txcost(gmrf_context_t *ctx, const gp_babel_neigh_t *neigh) {
- if ((gmrf_now(ctx->gmrf) - neigh->last_ihu)/10 > GP_BABEL_IHU_TIMEOUT(neigh->ihu_interval) || !neigh->iface)
+ if (gp_babel_since(ctx, neigh->last_ihu) > GP_BABEL_IHU_TIMEOUT(neigh->ihu_interval) || !neigh->iface)
return GP_BABEL_INFINITY;
else
return neigh->txcost;