[Dnsmasq-discuss] dnsmasq giving new addresses despite of leases file
Simon Kelley
simon at thekelleys.org.uk
Mon Mar 8 15:20:11 GMT 2010
Leonardo Rodrigues wrote:
>
> Hi,
>
> I'm running dnsmasq 2.52 on OpenWRT with, among other options:
>
> -l /etc/dnsmasq/dhcpd.leases
> --dhcp-range=lan,192.168.8.50,192.168.8.200,255.255.255.0,1440h
>
> 1440h = 60 days = 2 months, that's the default lease expiration
>
> from my backup, which was made some few hours before the supposed
> problem i'll post in this message, i have:
>
> root at sede:~/backup/a/etc/dnsmasq# grep b8:94 dhcpd.leases
> 1270407878 00:16:44:b8:94:e3 192.168.8.87 noteludy 01:00:16:44:b8:94:e3
> root at sede:~/backup/a/etc/dnsmasq#
>
> the timestamp, converted to human-readable date, would be 04/04/2010
> @ 14:04 ..... which means the lease was NOT expired yet and was
> generated last week when i was running with 30 days expire time which
> was later changed to 60 days. Despite of that change from 30 to 60,
> lease is NOT expired yet.
>
> the machine with that MAC address 'arrived' on the network which the
> ip address of another network and tried to renew it. dnsmasq correctly
> denied it, because that address is not on the actual lan it's running.
> Anyway, after denying it, dnsmasq provided a new address from its range,
> not honoring the lease present on the leases file which was still valid
> and NOT expired.
>
>
> root at sede:~/backup/a/etc/dnsmasq# logread | grep 00:16:44:b8:94:e3
> Mar 8 11:26:54 sede daemon.info dnsmasq-dhcp[10347]: DHCPREQUEST(eth1)
> 192.168.1.101 00:16:44:b8:94:e3
> Mar 8 11:26:54 sede daemon.info dnsmasq-dhcp[10347]: DHCPNAK(eth1)
> 192.168.1.101 00:16:44:b8:94:e3 wrong address
> Mar 8 11:26:54 sede daemon.info dnsmasq-dhcp[10347]: DHCPREQUEST(eth1)
> 192.168.1.101 00:16:44:b8:94:e3
> Mar 8 11:26:54 sede daemon.info dnsmasq-dhcp[10347]: DHCPNAK(eth1)
> 192.168.1.101 00:16:44:b8:94:e3 wrong network
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPDISCOVER(eth1)
> 00:16:44:b8:94:e3
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPOFFER(eth1)
> 192.168.8.80 00:16:44:b8:94:e3
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPDISCOVER(eth1)
> 00:16:44:b8:94:e3
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPOFFER(eth1)
> 192.168.8.80 00:16:44:b8:94:e3
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPREQUEST(eth1)
> 192.168.8.80 00:16:44:b8:94:e3
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPACK(eth1)
> 192.168.8.80 00:16:44:b8:94:e3 noteludy
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPREQUEST(eth1)
> 192.168.8.80 00:16:44:b8:94:e3
> Mar 8 11:27:03 sede daemon.info dnsmasq-dhcp[10347]: DHCPACK(eth1)
> 192.168.8.80 00:16:44:b8:94:e3 noteludy
> root at sede:~/backup/a/etc/dnsmasq#
>
>
>
> shouldnt dnsmasq provide the IP present on its lease file, given the
> fact that lease was still valid ???
>
Good question: I can give you a partial answer, the lease gets deleted
as part of the response to the first DHCPREQUEST. Here's the code in
question.
{
message = _("wrong address");
/* avoid loops when client brain-dead */
lease_prune(lease, now);
lease = NULL;
}
What I can't answer is what the "brain-dead" behaviour is/was that's
getting countered here. The "lease prune" call was added in version
2.41, but there's no explanation in the changelog :-( and I can't
remember why it was added.
I suspect that some client somewhere kept trying with the wrong address
instead of falling back to a DHCPDISCOVER.
Cheers,
Simon.
>
> --
>
>
> Atenciosamente / Sincerily,
> Leonardo Rodrigues
> Solutti Tecnologia
> http://www.solutti.com.br
>
> Minha armadilha de SPAM, NÃO mandem email
> gertrudes at solutti.com.br
> My SPAMTRAP, do not email it
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
More information about the Dnsmasq-discuss
mailing list