diff options
| author | Jan-Philipp Litza | 2019-07-04 11:31:25 +0000 |
|---|---|---|
| committer | Hans Dedecker | 2019-07-07 20:02:49 +0000 |
| commit | f6c2242c7af2de8f40f5b6b8e50c350a138bc183 (patch) | |
| tree | a497c115cdd2864d09a1aa14153fdef1e68f4ffe | |
| parent | d11180932b2fb8784aaad0830c032e42b8bb64ac (diff) | |
| download | odhcpd-f6c2242c7af2de8f40f5b6b8e50c350a138bc183.tar.gz | |
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>
| -rw-r--r-- | src/router.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/router.c b/src/router.c index 5032428..0040e7a 100644 --- a/src/router.c +++ b/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; |