Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 538544

Summary: net-misc/dhcpcd-6.6.7 disregards timeout parameter if in test mode
Product: Gentoo Linux Reporter: RumpletonBongworth <kfm>
Component: Current packagesAssignee: William Hubbs <williamh>
Status: RESOLVED OBSOLETE    
Severity: normal CC: roy
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description RumpletonBongworth 2015-02-02 15:23:37 UTC
After upgrading to dhcpcd-6.6.7, I noticed that the --timeout parameter is not respected, breaking one of my monitoring scripts. It can be trivially demonstrated by setting a low value. I don't know when this regression was introduced but can confirm that 6.4.7 works as expected.
Comment 1 RumpletonBongworth 2015-02-02 15:32:11 UTC
Here's a concrete demonstration of the issue, in a situation where no response is provided:

lb1 dhcpcd # dhcpcd -LT -d eth0 -t 5
dhcpcd[3576]: version 6.6.7 starting
dhcpcd[3576]: DUID 00:01:00:01:1b:ac:ad:5a:00:1b:21:cf:02:08
dhcpcd[3576]: eth0: IAID 21:cf:02:08
dhcpcd[3576]: eth0: delaying IPv4 for 0.2 seconds
dhcpcd[3576]: eth0: soliciting a DHCP lease
dhcpcd[3576]: eth0: sending DISCOVER (xid 0xbe6fd178), next in 3.3 seconds
dhcpcd[3576]: eth0: invalid UDP packet from 10.0.2.8
dhcpcd[3576]: eth0: sending DISCOVER (xid 0xbe6fd178), next in 7.4 seconds
dhcpcd[3576]: eth0: sending DISCOVER (xid 0xbe6fd178), next in 16.8 seconds
dhcpcd[3576]: eth0: sending DISCOVER (xid 0xbe6fd178), next in 32.9 seconds
dhcpcd[3576]: eth0: sending DISCOVER (xid 0xbe6fd178), next in 63.4 seconds

... and so it goes on.

Further, if the -t parameter is omitted, it does *not* time out after 30 seconds as the man page implies.
Comment 2 Roy Marples 2015-02-03 09:01:05 UTC
This only happens when you specify the -T flag, for testing.
Why are you using this flag?

Fixed here anyway.
http://roy.marples.name/projects/dhcpcd/ci/659219d5589d93715841a93eb91885cc4337b58b?sbs=0
Comment 3 RumpletonBongworth 2015-02-03 09:47:02 UTC
Well, why not? The test mode is well implemented and I use the program as part of a DHCPD failover mechanism. I wait upon changes to the leases file via inotify in order to keep them in sync, with periodic breaks to test whether any other host is servicing DISCOVER requests. If so, any local instance of dhcpd is stopped, otherwise it is started. Such an approach does not work properly if the run time of the client is unpredictable. Whatever the use case may be, the timeout parameter is not documented as being context sensitive so it came as a surprise.
Comment 4 Roy Marples 2015-02-03 14:20:48 UTC
It's not supposed to be context sensitive, the issue will be fixed in the next dhcpcd release. Gentoo can decide if they want to fix it in an ebuild or not for the time being.
Comment 5 RumpletonBongworth 2015-02-03 15:00:12 UTC
(In reply to Roy Marples from comment #4)
> It's not supposed to be context sensitive, the issue will be fixed in the
> next dhcpcd release. Gentoo can decide if they want to fix it in an ebuild
> or not for the time being.

Roger that. Thanks.
Comment 6 Roy Marples 2015-03-27 22:26:59 UTC
Fixed in 6.8.1, now in portage