From: Nikolay Martynov Date: Tue, 1 Jul 2014 02:42:55 +0000 (-0400) Subject: leasefile: do not output expired dhcpv6 leases X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=commitdiff_plain;h=382dc50adfa33f55828a482773a1fcfea624a4b5;hp=d8d6d784258b64d23e7f1cc0a2ee02e88377707d leasefile: do not output expired dhcpv6 leases Sometimes ip that is assigned to a host changes, old ip is still kept aroung as 'expired'. This expired ip gets dumped into leasefile and is read by dnsmasq. The result is that hotsname is resolved into expired ip and that confuses clients. This patch prevents expired leases from being written into leasefile. --- diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 181973d..fe47130 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -258,6 +258,8 @@ void dhcpv6_write_statefile(void) for (size_t i = 0; i < addrlen; ++i) { if (addrs[i].prefix > 96) continue; + if (c->valid_until <= now) + continue; addr = addrs[i].addr; if (c->length == 128)