Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215174 - net-misc/dhcpcd-3.2.3 is unable to get an address
Summary: net-misc/dhcpcd-3.2.3 is unable to get an address
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-28 12:42 UTC by Remy Blank
Modified: 2008-03-28 16:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Traffic dump from tcpdump (tcpdump.txt,5.25 KB, text/plain)
2008-03-28 12:44 UTC, Remy Blank
Details
Output of an strace of dhcpcd (strace.txt,83.26 KB, text/plain)
2008-03-28 12:46 UTC, Remy Blank
Details
Output of emerge --info (emerge-info.txt,3.95 KB, text/plain)
2008-03-28 12:48 UTC, Remy Blank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Blank 2008-03-28 12:42:27 UTC
I updated today to net-misc/dhcpcd-3.2.3, and one of my computers is unable to get an address from my ISP's dhcp server. I downgraded to dhcpcd-3.1.5-r1 and it works again.

Here's some info about the computer:

# uname -a
Linux morpheus 2.6.19-gentoo-r5 #3 PREEMPT Sat Jul 28 11:24:36 CEST 2007 i686 Intel(R) Celeron(R) CPU 1.80GHz GenuineIntel GNU/Linux

dhcpcd is run on eth2, which is connected to a cable modem. The network card is driven by the sis900 driver and is a:

00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)

Looking at a traffic dump from tcpdump and an strace of the dhcpcd process, it looks as if the DHCP server is actually responding, but dhcpcd never gets the reply. Something wrong in the packet filter program (IIUC the big difference between 3.1.5 and 3.2.3)?

I will attach the traffic dump and the strace output.
Comment 1 Remy Blank 2008-03-28 12:44:26 UTC
Created attachment 147535 [details]
Traffic dump from tcpdump

This is the output of:

tcpdump -nl -i eth2 port 68 -vvv -XX

It shows that every request received a reply.
Comment 2 Remy Blank 2008-03-28 12:46:59 UTC
Created attachment 147537 [details]
Output of an strace of dhcpcd

This is the output of:

strace ./dhcpcd --test eth2

It shows that the process didn't receive any of the replies from the server.

Please let me know if you need any additional info.
Comment 3 Remy Blank 2008-03-28 12:48:47 UTC
Created attachment 147542 [details]
Output of emerge --info
Comment 4 Remy Blank 2008-03-28 13:06:22 UTC
Some additional info: if I disable the packet filter by commenting out the setsockopt(fs, SOL_SOCKET, SO_ATTACH_FILTER, ...) call in socket.c, I can run dhcpcd --test eth2 successfully.
Comment 5 Remy Blank 2008-03-28 13:31:49 UTC
More news (sorry for spamming): If I replace the following line in the packet filter program:

	BPF_STMT (BPF_RET + BPF_K, ~0U),

with that one:

	BPF_STMT (BPF_RET + BPF_K, 65536),

then dhcpcd --test eth2 works. Actually, any number big enough but lower than or equal to 2^31-1 seems to work. 2^31 doesn't work anymore. So it looks like the packet filter doesn't like "negative" values (actually, the value is stored as unsigned, so it normally shouldn't care).

Could this be due to a bug in my kernel version? On another machine, dhcpcd-3.2.3 works flawlessly:

$ uname -a
Linux pat 2.6.22-rbl-r9 #1 PREEMPT Fri Nov 2 23:17:14 CET 2007 i686 Intel(R) Pentium(R) M processor 1.60GHz GenuineIntel GNU/Linux

I'll start looking at the kernel changelog, and I'll try to update the older machine to 2.6.24.
Comment 6 Roy Marples 2008-03-28 13:48:06 UTC
Try replacing it with

BPF_STMT (BPF_RET + BPF_K, (uint)-1),
Comment 7 Roy Marples 2008-03-28 13:48:39 UTC
But yes, please try a newer kernel as well :)
Comment 8 Remy Blank 2008-03-28 16:16:22 UTC
(In reply to comment #6)
> Try replacing it with
> 
> BPF_STMT (BPF_RET + BPF_K, (uint)-1),

Doesn't work either. For the newer kernel, it will take a bit more time, but I'll get there eventually.
Comment 9 Remy Blank 2008-03-28 16:42:54 UTC
Ok, I got it. The fix was committed here:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.24.y.git;a=commit;h=dbcb5855d108b7fa20ab42567a5412ce9dcd776a

Sorry for the noise.