summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2015-08-20 10:45:31 +0200
committerSteven Barth <steven@midlink.org>2015-08-20 10:45:31 +0200
commit2fd5d19525699f19186daca9b246dd37a0f547a0 (patch)
tree631b347335b7a0466b5bbfc8b706d76ae7573f22 /src
parent8b33974cfae233ef6ad764051a3194db29c7ff11 (diff)
router: improve deprecation handling
Diffstat (limited to 'src')
-rw-r--r--src/router.c2
-rw-r--r--src/router.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/router.c b/src/router.c
index d7452f5..1ae8d1a 100644
--- a/src/router.c
+++ b/src/router.c
@@ -314,6 +314,8 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
p->nd_opt_pi_valid_time = htonl(TIME_LEFT(addr->valid, now));
if (addr->preferred > (uint32_t)now)
p->nd_opt_pi_preferred_time = htonl(TIME_LEFT(addr->preferred, now));
+ else if (addr->valid - now < 7200)
+ p->nd_opt_pi_valid_time = 0;
if (TIME_LEFT(addr->preferred, now) > dns_time) {
diff --git a/src/router.h b/src/router.h
index 720490d..5b5f4d7 100644
--- a/src/router.h
+++ b/src/router.h
@@ -31,7 +31,7 @@ struct icmpv6_opt {
#define MaxValidTime 65535
-#define MaxRtrAdvInterval (MaxValidTime / 3)
+#define MaxRtrAdvInterval 1800
#define ND_RA_FLAG_PROXY 0x4
#define ND_RA_PREF_HIGH (1 << 3)