Browse Source

router: support ra_lifetime being 0

The value 0 has the special meaning of not being a default router. This
is useful to only advertise prefixes or DNS settings without being a
real router.

Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
Jan-Philipp Litza 4 years ago
parent
commit
f6c2242c7a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/router.c

+ 1 - 1
src/router.c

@@ -354,7 +354,7 @@ static uint32_t calc_ra_lifetime(struct interface *iface, uint32_t maxival)
 
 	if (iface->ra_lifetime >= 0) {
 		lifetime = iface->ra_lifetime;
-		if (lifetime < maxival)
+		if (lifetime > 0 && lifetime < maxival)
 			lifetime = maxival;
 		else if (lifetime > 9000)
 			lifetime = 9000;