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 <dedeckeh@gmail.com>
}
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;