summaryrefslogtreecommitdiffstats
path: root/src/neigh.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-03 03:08:04 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-03 03:08:04 +0200
commit48f77c26dcb4a9e8d09e718f1b16e6b97c04d9b9 (patch)
tree97c5c77b15b82e5ba68f0b60abb04151ca78821a /src/neigh.c
parent8ca5dead7f2870ae7a3ea40f40bec5cb9acde2d0 (diff)
downloadbabel-48f77c26dcb4a9e8d09e718f1b16e6b97c04d9b9.tar
babel-48f77c26dcb4a9e8d09e718f1b16e6b97c04d9b9.zip
Add gp_babel_since helper
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;