[Dnsmasq-discuss] dnsmasq giving new addresses despite of leases file
Simon Kelley
simon at thekelleys.org.uk
Mon Mar 8 16:16:02 GMT 2010
Leonardo Rodrigues wrote:
> Em 08/03/2010 12:20, Simon Kelley escreveu:
>>> 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.
>>
>>
>
>
> Hi Simon,
>
> I've checked logs and found no other 'wrong address' cases than
> this one. In fact all machines on this network are desktops and this one
> which is giving the problem is the only notebook on the network.
>
> anyway, do you think enabling the '--log-dhcp' option can provide
> some useful information ? Is there any way of getting debug logging
> enabled AND going to background ? I've found the debug options, but
> seems all of them keep process in the foreground, which unfortunelly is
> not possible to me, as this is a small device running OpenWRT, i have no
> monitor/keyboard attached to this machine.
>
> anyway, do you think debug modes could provide some useful
> information ?
>
I understand what is happening, what I'm less sure of is why that code
to delete the lease was added: without it, the behaviour would be
exactly what you want (and seems quite correct).
The code in question was added about 2 and half years ago, and I've now
found the relevant emails in my archive. It seems that the "braindead
client" was a particular buggy release of dhcpcd, which is long-ago
fixed. It should therefore be safe to remove the lease deletion code again.
Can you build new dnsmasq packages from source for your WRT box? If so
I'll get a test release to you with the changes implemented.
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list