Slackware 10.2 Broken dhclient

Submitted by Eus
on February 24, 2009 - 7:34pm

I have used Slackware 10.2 since 2007 after I upgraded from Slackware 10.1.
What I didn't know was that Slackware 10.2 was shipped with a broken dhclient.

I didn't notice that before because I always accessed the Internet from another computer instead of my laptop.
I was aware of this in October 2008 when I often accessed the Internet with my laptop.

The first try of sniffing the network with Wireshark on the localhost to see whether the DHCP packet sent from my laptop was correct showed that the UDP checksum of the packet was incorrect.

Checksum: 0x0145 [incorrect, should be 0x6738 (maybe caused by "UDP checksum offload"?)]

Googling from `UPD checksum offload' that was related to DHCP and Slackware 10.2 didn't help much.

But, sniffing the network on another host revealed that the checksum of the DHCP packet was correct.
So, the problem was not with the checksum.
However, I noticed that under `Bootstrap Protocol', `Hardware type' was `NET/ROM pseudo' instead of `Ethernet'.
The problem was further narrowed down when I noticed that the output of dhclient from my laptop and another host differed as follows:

My laptop:

Listening on Socket/eth0
Sending on   Socket/eth0

Another host:

Listening on LPF/eth0/00:16:ec:8a:78:e4
Sending on   LPF/eth0/00:16:ec:8a:78:e4

So, I tried to build dhclient from its source code. This one worked pretty fine.
I concluded that the problem lied in the way Slackware 10.2 built the source of dhcp-3.0.3.
This is because a fresh build of the pristine source and its subsequent installation on the existing problematic Slackware 10.2 worked.
However, doing `installpkg dhcp-3.0.3-i486-1.tgz' after the installation of the pristine source just did not work.
At this point, I was busy with other stuff and so left this for a while.

Just today I ran the sane and problematic dhclient under GDB that revealed that `if_register_receive()' was called from socket.c instead of lpf.c in the problematic one. Since `if_register_receive()' is not a callback function, I concluded that either the `configure' script or the `Makefile' had something to do with this.

The `Makefile' showed that lpf.c was used when the system was linux whose major version was 2 and minor version was greater than 2.
However, the `configure' script showed that those versions were only defined when it was called without any argument.
There was a bug in the `configure' script that made it not provide the versions when it was called with an argument, which was the name and the versions of the system itself.
Unfortunately, Slackware 10.2 called the `configure' script with an argument: `./configure linux-2.2'
Since I knew that Slackware 12.0 didn't have this problem, I looked at its dhcp-3.0.5 source code.
And, yes, there was a patch to fix the error in the `configure' script.

Now after four months had passed, finally I resolved the problem. The bug was in the `configure' script.

Keywords: slackware 10.2 dhclient does not work udp error checksum NET/ROM pseudo