summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2012-11-14 10:15:38 +0000
committerRoy Marples <roy@marples.name>2012-11-14 10:15:38 +0000
commit323b06a0d3fb5ce1050cfe2079ea42adfe20cbf3 (patch)
treec71a42acb3eb1b5b742c9e2ea0f693255bf4221f
parent7125938e4eed4aa86d45c2e5e97151607c97a50c (diff)
downloaddhcpcd-323b06a0d3fb5ce1050cfe2079ea42adfe20cbf3.tar.xz
If we receive a RA with a lifetime of 0, just expire it right away
and continue.
-rw-r--r--ipv6rs.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ipv6rs.c b/ipv6rs.c
index 3a8dd691..3737d91c 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -438,6 +438,17 @@ ipv6rs_handledata(_unused void *arg)
break;
}
+ nd_ra = (struct nd_router_advert *)icp;
+ /* If the lifetime of the router is zero, just expire it
+ * if we already have it and move on. */
+ if (nd_ra->nd_ra_router_lifetime == 0) {
+ if (rap) {
+ rap->lifetime = 0;
+ ipv6rs_expire(ifp);
+ }
+ return;
+ }
+
/* We don't want to spam the log with the fact we got an RA every
* 30 seconds or so, so only spam the log if it's different. */
if (options & DHCPCD_DEBUG || rap == NULL ||
@@ -473,7 +484,6 @@ ipv6rs_handledata(_unused void *arg)
}
get_monotonic(&rap->received);
- 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) {