summaryrefslogtreecommitdiffstats
path: root/ipv6rs.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2012-08-06 19:32:15 +0000
committerRoy Marples <roy@marples.name>2012-08-06 19:32:15 +0000
commitea112ab290d35fe4df41df4f77be50b005934402 (patch)
tree6b21ee30795e5d7e1c982349c79a727e168ac440 /ipv6rs.c
parent383929ca7ac501839919947f53ec58e3a2a8119d (diff)
downloaddhcpcd-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.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ipv6rs.c b/ipv6rs.c
index 3a837a1d..4d2bd244 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -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);
}
}