From: Hans Dedecker Date: Tue, 21 Feb 2017 08:54:36 +0000 (+0100) Subject: router: don't announce prefixes with valid lifetime equal to 0 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1b630f8bc59978884c9caccebca3b6d8e9b045a1;p=project%2Fodhcpd.git router: don't announce prefixes with valid lifetime equal to 0 Don't set prefix valid lifetime to 0 in case the preferred lifetime equals 0 and valid lifetime gets smaller than 7200. In corner cases it leads to router lifetime being set although no prefixes are announced with a valid lifetime different from 0. Signed-off-by: Hans Dedecker --- diff --git a/src/router.c b/src/router.c index ffafb94..e8a9aa9 100644 --- a/src/router.c +++ b/src/router.c @@ -358,11 +358,8 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add } valid = TIME_LEFT(addr->valid, now); - if (iface->ra_useleasetime) { - if (valid > iface->dhcpv4_leasetime) - valid = iface->dhcpv4_leasetime; - } else if (!preferred && valid < 7200) - valid = 0; + if (iface->ra_useleasetime && valid > iface->dhcpv4_leasetime) + valid = iface->dhcpv4_leasetime; if (minvalid > valid) minvalid = valid;