On Thu, 2006-01-19 at 02:14 -0800, Andrew Morton wrote: > i.e. the kernel obtains all the network parameters correctly from > 192.168.10.1, but reports that the DHCP response has been received > from 192.168.10.10
In his case, ipconfig code prints the server address found in the bootp header (the one you can set with "next-server" in isc-dhcpd config). There is a test in the code to make dhcp server address take precedence over bootp header but the test is wrong since it is done for OFFER packets and not ACK. The attached patch make the test actually do something and fix the reported bug, _but_ it will break nfsroot for people having this kind of dhcpd configuration: dhcp server address: X.X.X.X dhcpd config: next-server Y.Y.Y.Y; option root-path "/export/fs"; and expect Linux to automatically use Y.Y.Y.Y as the nfs server: X.X.X.X will be used now. They will have to add the ip address at the beginning of root-path to get the old behaviour back. I'm not sure what should be printed as the "bootserver" address for the above configuration. With this patch is will print X.X.X.X, instead of Y.Y.Y.Y. So if we consider current behaviour regarding server precedence to be buggy, this fixes it. Else, we will need to somewhat hack the current code to make the printk correct. Signed-off-by: Maxime Bizon <[EMAIL PROTECTED]> --- linux-2.6.16-rc1/net/ipv4/ipconfig.c.old 2006-01-17 08:44:47.000000000 +0100 +++ linux-2.6.16-rc1/net/ipv4/ipconfig.c 2006-01-20 00:30:01.000000000 +0100 @@ -962,19 +962,19 @@ printk(" by server %u.%u.%u.%u\n", NIPQUAD(ic_servaddr)); #endif - /* The DHCP indicated server address takes - * precedence over the bootp header one if - * they are different. - */ - if ((server_id != INADDR_NONE) && - (b->server_ip != server_id)) - b->server_ip = ic_servaddr; break; case DHCPACK: if (memcmp(dev->dev_addr, b->hw_addr, dev->addr_len) != 0) goto drop_unlock; + /* The DHCP indicated server address takes + * precedence over the bootp header one if + * they are different. + */ + if (server_id != INADDR_NONE) + b->server_ip = server_id; + /* Yeah! */ break; -- Maxime - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html