Commit 55b548ae authored by Simon Kelley's avatar Simon Kelley

Add RA_INTERVAL parameter in config.h

parent 3b43646a
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#define SOA_REFRESH 1200 /* SOA refresh default */ #define SOA_REFRESH 1200 /* SOA refresh default */
#define SOA_RETRY 180 /* SOA retry default */ #define SOA_RETRY 180 /* SOA retry default */
#define SOA_EXPIRY 1209600 /* SOA expiry default */ #define SOA_EXPIRY 1209600 /* SOA expiry default */
#define RA_INTERVAL 600 /* Send unsolicited RA's this often when not provoked. */
/* compile-time options: uncomment below to enable or do eg. /* compile-time options: uncomment below to enable or do eg.
make COPTS=-DHAVE_BROKEN_RTC make COPTS=-DHAVE_BROKEN_RTC
......
...@@ -390,8 +390,8 @@ static int add_prefixes(struct in6_addr *local, int prefix, ...@@ -390,8 +390,8 @@ static int add_prefixes(struct in6_addr *local, int prefix,
if (time > context->lease_time) if (time > context->lease_time)
{ {
time = context->lease_time; time = context->lease_time;
if (time < 600u) if (time < ((unsigned int)RA_INTERVAL))
time = 600; time = RA_INTERVAL;
} }
if (context->flags & CONTEXT_DEPRECATE) if (context->flags & CONTEXT_DEPRECATE)
...@@ -572,8 +572,8 @@ static int iface_search(struct in6_addr *local, int prefix, ...@@ -572,8 +572,8 @@ static int iface_search(struct in6_addr *local, int prefix,
/* range 5 - 20 */ /* range 5 - 20 */
context->ra_time = param->now + 5 + (rand16()/4400); context->ra_time = param->now + 5 + (rand16()/4400);
else else
/* range 450 - 600 */ /* range 3/4 - 1 times RA_INTERVAL */
context->ra_time = param->now + 450 + (rand16()/440); context->ra_time = param->now + (3 * RA_INTERVAL)/4 + ((RA_INTERVAL * (unsigned int)rand16()) >> 18);
/* zero timers for other contexts on the same subnet, so they don't timeout /* zero timers for other contexts on the same subnet, so they don't timeout
independently */ independently */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment