ifnet: also store the HNA validity time in msec
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 1 May 2015 14:44:32 +0000 (16:44 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 8 May 2015 12:44:51 +0000 (14:44 +0200)
For performance reasons in a later patch.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/interfaces.h
src/unix/ifnet.c

index e50e54e..90472c3 100644 (file)
@@ -100,6 +100,7 @@ struct vtimes {
   uint8_t tc;
   uint8_t mid;
   uint8_t hna;
+  uint32_t hna_reltime;
 };
 
 /* Output buffer structure. This should actually be in net_olsr.h but we have circular references then.
index 45318af..252be24 100644 (file)
@@ -496,6 +496,7 @@ add_hemu_if(struct olsr_if *iface)
   ifp->valtimes.tc = reltime_to_me(iface->cnf->tc_params.validity_time * MSEC_PER_SEC);
   ifp->valtimes.mid = reltime_to_me(iface->cnf->mid_params.validity_time * MSEC_PER_SEC);
   ifp->valtimes.hna = reltime_to_me(iface->cnf->hna_params.validity_time * MSEC_PER_SEC);
+  ifp->valtimes.hna_reltime = me_to_reltime(ifp->valtimes.hna);
 
   ifp->mode = iface->cnf->mode;
 
@@ -839,6 +840,7 @@ chk_if_up(struct olsr_if *iface, int debuglvl __attribute__ ((unused)))
   ifp->valtimes.tc = reltime_to_me(iface->cnf->tc_params.validity_time * MSEC_PER_SEC);
   ifp->valtimes.mid = reltime_to_me(iface->cnf->mid_params.validity_time * MSEC_PER_SEC);
   ifp->valtimes.hna = reltime_to_me(iface->cnf->hna_params.validity_time * MSEC_PER_SEC);
+  ifp->valtimes.hna_reltime = me_to_reltime(ifp->valtimes.hna);
 
   ifp->mode = iface->cnf->mode;