←back to thread

354 points timdoug | 1 comments | | HN request time: 0.739s | source
Show context
dotBen ◴[] No.2755572[source]
There already exists a minimal DHCP client implementation in the Linux kernel, but it lacks certain features such as configuring the DNS nameservers.

I wonder if it is possible to use the kernel-level DHCP client to instantly request the IP address while asynchronously initiating the more functional user-mode dhclient?

Once dhclient is up, and the kernel DHCP client has obtained an IP address it could just pass that to the DHClient to make another DHCP request with the same IP but the additional DNS nameservers, etc. The DHCP server would just see this as a re-request for the same IP address from the same MAC address and would just re-ACK.

This would save the time it takes to initiate dhclient to then perform the initial IP address check + request.

EDIT: in fact, I don't get (from the OP's link) why dhclient couldn't just be forced to accept the IP address passed to it by the kernel DHCP client, and bind it with the nameservers/any other info locally without needing to make another round-trip to the DHCP server.

replies(1): >>2757796 #
hristov ◴[] No.2757796[source]
The whole kernel discussion seems to be a red herring. The reason the android device was so slow is because the DHCP server timed out twice on a DHCP request. Those two timeouts caused 10s of the 11s delay.

I think there probably was something wrong with the DHCP server configuration.

replies(1): >>2757923 #
caf ◴[] No.2757923[source]
It timed out because it wasn't there, not because it was misconfigured. The tablet was revalidating its previous lease, which was from a different network - so it was sending the request to the previously-known server address.
replies(1): >>2758006 #
1. hristov ◴[] No.2758006[source]
I am pretty sure that request is supposed to be broadcast across the entire subnet.