Add RA_INTERVAL parameter in config.h

This commit is contained in:
Simon Kelley
2012-12-29 17:13:04 +00:00
parent 3b43646a08
commit 55b548ae2b
2 changed files with 5 additions and 4 deletions

View File

@@ -46,6 +46,7 @@
#define SOA_REFRESH 1200 /* SOA refresh default */
#define SOA_RETRY 180 /* SOA retry 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.
make COPTS=-DHAVE_BROKEN_RTC

View File

@@ -390,8 +390,8 @@ static int add_prefixes(struct in6_addr *local, int prefix,
if (time > context->lease_time)
{
time = context->lease_time;
if (time < 600u)
time = 600;
if (time < ((unsigned int)RA_INTERVAL))
time = RA_INTERVAL;
}
if (context->flags & CONTEXT_DEPRECATE)
@@ -572,8 +572,8 @@ static int iface_search(struct in6_addr *local, int prefix,
/* range 5 - 20 */
context->ra_time = param->now + 5 + (rand16()/4400);
else
/* range 450 - 600 */
context->ra_time = param->now + 450 + (rand16()/440);
/* range 3/4 - 1 times RA_INTERVAL */
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
independently */