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.
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)