[Dnsmasq-discuss] [PATCH] Nack requests for unknown leases.

Simon Kelley simon at thekelleys.org.uk
Tue Apr 25 21:39:31 BST 2017

> What I did to fix it was to send a NACK to the initial DHCP request,
> which luckily convinced the ISC DHCP client to stop asking for the
> same IP address in the following DHCP discovery. However, NACK will
> not quarantee all DHCP clients will do the same, so the case where
> DHCP discovery is carrying a conflicting option-50 should also be
> fixed IMO.

It also violates RFC 2131, para 4.3.2

     "If the DHCP
      server has no record of this client, then it MUST remain silent,
      and MAY output a warning to the network administrator. This
      behavior is necessary for peaceful coexistence of non-
      communicating DHCP servers on the same wire."

> Unfortunately dnsmasq does not send ICMP echo requests when DHCP
> discovery packet carries an OPTION_REQUESTED_IP, see DHCPDISCOVER case
> in file rfc2131.c starting from line 990:
> ...
>           else if (opt && address_available(context, addr,
> tagif_netid) && !lease_find_by_addr(addr) &&
>                   !config_find_by_address(daemon->dhcp_conf, addr))
>            mess->yiaddr = addr;

That's possibly a bug. Let me think about if there's a reason for that
(This is 10-year old code.....)

However, doing that doesn't defend against the case that a client with a
statically-configured address turns up on a network _after_ the address
got leased to another machine. The only way to do that is not to give
static addresses in the range that you told your DHCP was available for
DHCP leases.



More information about the Dnsmasq-discuss mailing list