Comment 4 for bug 327703

Revision history for this message
FactTech (launchpad-facttechnologies) wrote :

FYI -- I'm seeing a repeat of this behavior under slightly different circumstances. In this case, I have a machine that was set up with Ubuntu 8.04 and was issued a lease. I rebooted the machine with an install disk for another distribution (it's Fluxbuntu 7.10 RC, which uses the 'alternate' text-based install type). When the installation gets to network autoconfiguration, it fails, and I see the same DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPNAK cycle as described originally.

Once again, there is an existing entry in the leases file associated with the MAC address for this machine's network card, which seems to be part of the problem. Perhaps it's the combination of parameters I've fed to dnsmasq?

The conf file has an entry:

  dhcp-host=foo

which, as I understand it, tells it to check /etc/hosts to get a standard IP assignment. In /etc/hosts, there's:

 192.168.X.X foo

only with real numbers instead of Xs, obviously. Currently in the leases file, there's a line:

  1234411797 11:22:33:44:55:66 192.168.X.X foo *

only with the real MAC address and IP, obviously.

I have a hunch that the cause is something like this:

 1. dnsmasq gets DHCPDISCOVER packet
 2. dnsmasq looks at originating MAC and checks leases file to see if it's in there
 3. dnsmasq finds line with same MAC and issues DHCPOFFER with associated IP address from lease file
 4. client does what's expected and makes DHCPREQUEST with that IP
 5. dnsmasq now takes a look at the client's machine name, and sees that the requested address is "reserved" for that name per /etc/hosts
 6. dnsmasq replies with DHCPNAK because doesn't realize it just sent out that address as available

It should be relatively easy to replicate this by obtaining a lease, changing hostname, then requesting a new lease.

I'm not the programmer (or even *a* programmer), but the best way to fix this would seem to be to not make the DHCPOFFER of an IP address in the /etc/hosts mappings unless the DHCP client's machine name is the one associated with it.

Let me know if I can do any further testing or provide additional information.