Fix bug #48876: nd6: timers should be in ticks, not ms

delay_time and stale_time are ticks now.
reachable_time and invalidation_timer are untouched since they may originate from telegram values -> not converting them to ticks avoids an integer division
This commit is contained in:
Dirk Ziegelmeier 2016-10-04 13:30:23 +02:00
parent cdc97d2779
commit ee27daffc4
2 changed files with 8 additions and 8 deletions

View File

@ -107,7 +107,7 @@ ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr)
if (neighbor_cache[i].state == ND6_STALE) {
/* Switch to delay state. */
neighbor_cache[i].state = ND6_DELAY;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL;
}
/* @todo should we send or queue if PROBE? send for now, to let unicast NS pass. */
if ((neighbor_cache[i].state == ND6_REACHABLE) ||

View File

@ -345,7 +345,7 @@ nd6_input(struct pbuf *p, struct netif *inp)
/* Delay probe in case we get confirmation of reachability from upper layer (TCP). */
neighbor_cache[i].state = ND6_DELAY;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL;
}
} else {
/* Add their IPv6 address and link-layer address to neighbor cache.
@ -366,7 +366,7 @@ nd6_input(struct pbuf *p, struct netif *inp)
/* Receiving a message does not prove reachability: only in one direction.
* Delay probe in case we get confirmation of reachability from upper layer (TCP). */
neighbor_cache[i].state = ND6_DELAY;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL;
}
/* Override ip6_current_dest_addr() so that we have an aligned copy. */
@ -593,7 +593,7 @@ nd6_input(struct pbuf *p, struct netif *inp)
/* Receiving a message does not prove reachability: only in one direction.
* Delay probe in case we get confirmation of reachability from upper layer (TCP). */
neighbor_cache[i].state = ND6_DELAY;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL;
}
}
if (i >= 0) {
@ -602,7 +602,7 @@ nd6_input(struct pbuf *p, struct netif *inp)
/* Receiving a message does not prove reachability: only in one direction.
* Delay probe in case we get confirmation of reachability from upper layer (TCP). */
neighbor_cache[i].state = ND6_DELAY;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME;
neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL;
}
}
}
@ -698,15 +698,15 @@ nd6_tmr(void)
}
break;
case ND6_STALE:
neighbor_cache[i].counter.stale_time += ND6_TMR_INTERVAL;
neighbor_cache[i].counter.stale_time++;
break;
case ND6_DELAY:
if (neighbor_cache[i].counter.delay_time <= ND6_TMR_INTERVAL) {
if (neighbor_cache[i].counter.delay_time <= 1) {
/* Change to PROBE state. */
neighbor_cache[i].state = ND6_PROBE;
neighbor_cache[i].counter.probes_sent = 0;
} else {
neighbor_cache[i].counter.delay_time -= ND6_TMR_INTERVAL;
neighbor_cache[i].counter.delay_time--;
}
break;
case ND6_PROBE: