router: improve deprecation handling
authorSteven Barth <steven@midlink.org>
Thu, 20 Aug 2015 08:45:31 +0000 (10:45 +0200)
committerSteven Barth <steven@midlink.org>
Thu, 20 Aug 2015 08:45:31 +0000 (10:45 +0200)
src/router.c
src/router.h

index d7452f553fce2ed59b7561801dc788de95eba618..1ae8d1aa7543d0ef1fff0e6c02dcc44ee69fbb33 100644 (file)
@@ -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) {
index 720490db107309155c50ddf1ed35395972af68e7..5b5f4d71a5a0ffb29a0e8b86a0043c384253d80e 100644 (file)
@@ -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)