diff options
| author | Roy Marples <roy@marples.name> | 2012-08-06 19:32:15 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2012-08-06 19:32:15 +0000 |
| commit | ea112ab290d35fe4df41df4f77be50b005934402 (patch) | |
| tree | 6b21ee30795e5d7e1c982349c79a727e168ac440 /ipv6rs.c | |
| parent | 383929ca7ac501839919947f53ec58e3a2a8119d (diff) | |
| download | dhcpcd-ea112ab290d35fe4df41df4f77be50b005934402.tar.xz | |
Change the NS times so that we assume reachable until the reachable
time expires, then send probes at retrans intervals until
DELAY_FIRST_PROBE_TIME is reached at which point we expire the router.
Diffstat (limited to 'ipv6rs.c')
| -rw-r--r-- | ipv6rs.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -447,6 +447,9 @@ ipv6rs_handledata(_unused void *arg) if (rap) { free(rap->data); rap->data_len = 0; + free(rap->ns); + rap->ns = NULL; + rap->nslen = 0; } syslog(LOG_INFO, "%s: Router Advertisement from %s", ifp->name, sfrom); @@ -473,6 +476,13 @@ ipv6rs_handledata(_unused void *arg) nd_ra = (struct nd_router_advert *)icp; rap->flags = nd_ra->nd_ra_flags_reserved; rap->lifetime = ntohs(nd_ra->nd_ra_router_lifetime); + if (nd_ra->nd_ra_reachable) { + rap->reachable = ntohl(nd_ra->nd_ra_reachable); + if (rap->reachable > MAX_REACHABLE_TIME) + rap->reachable = 0; + } + if (nd_ra->nd_ra_retransmit) + rap->retrans = ntohl(nd_ra->nd_ra_retransmit); rap->expired = 0; len -= sizeof(struct nd_router_advert); @@ -706,8 +716,7 @@ ipv6rs_handledata(_unused void *arg) options & DHCPCD_IPV6RA_OWN_DEFAULT) { rap->nsprobes = 0; - add_timeout_sec(REACHABLE_TIME, ipv6ns_unreachable, rap); - add_timeout_sec(DELAY_FIRST_PROBE_TIME, ipv6ns_sendprobe, rap); + ipv6ns_sendprobe(rap); } } |
