Roy's Blog

A Hacker's musings on Code | Tech | Life

Hmmmm, all my blogs appear to be about dhcpcd these days. No bad thing though eh? Anyway, if you've been using dhcpcd-4.0.0-rc1 or rc2, you should update to rc3 as it fixes an issue with infinite leases and a potential issue with lease time overflowing time_t (as uint32_t is greater than time_t on 32-bit platforms). To get around this issue, we simply treat any unusable leases as infinite. This shouldn't be a problem as we base all our times around a monotonic clock instead of the actual time which means that when dhcpcd restarts you can handle leases of up to 67 years ahead. As dhcpcd runs, the maximum lease length it can handle starts to decrease. On 64-bit platforms, this issue is pretty much irrelevant as time_t is a lot bigger than uint32_t so they can handle any lease time you throw at it.

But this should be viewed as a non issue as in the real world, leases just are not that long. beta9 did not suffer from this as it used a decreasing timeout, but this proved to be inaccurate. Also for IPv4LL compliance we needed to introduce a second time, and for being able to exit on time for the userland a third time. Moving to a monotonic clock approach is much easier to manage, but did cause the above two bugs introduced in rc1.

NetBSD has also imported rc3 into -current (4.99.71) :) NetworkManager svn (0.7.0) also supports rc3, but it needs to be configured for it if both dhcpcd and dhclient are on the same box.

./configure --with-dhcp-client=dhcpcd

Discuss this Post

Although a lot of code has changed and been added from beta9 it's had a lot of testing. Probably more testing than any dhcpcd release to date. You now have the aforementioned link carrier detection which is needed for dhcpcd to fully pass Apples Bonjour Conformance Test suite. Well, the IPv4LL section anyway as it's the only part that applies.

Props for this release go to Michael Durrant of Arcturus Networks for fully testing dhcpcd for IPv4LL compliance (as it requires OSX to run the test tool, which I don't have) and generally finding little "corner cases" which break things.

Discuss this Post

So I spent all last week in bed :DOK, that's a small lie. I spent the evenings in the bedroom as the lounge was being re-painted. It's now a nice just off white colour for that nice spaceous look :) The end result of course meant a lack of WoW playing. But that was no bad thing as I got some quality time in with Abbey and Robyn :P Thanks to "Rob" for buying me 300 on DVD - I'll hopefully watch it this weekend over a few beers :)Oh yeah - if you (yes, you the reader!) put your name on future gifts for me (keep em rolling - they're all good ;) ), it's probably also an idea to put your screen name on too as I know quite a few "Rob"s, the most obvious one being my brother

Discuss this Post

OK, so one of the most popular questions asked on the Gentoo forums is "How can I stop DHCP from stalling startup?"Well, as Gentoo is very minimal, it does not come with ifplugd or netplug by default - simply installing either solves this for wired. wpa_supplicant comes with an action script for wpa_cli to solve this for wireless also.NetBSD ships with ifwatchd for wired and wireless, but it's not enabled by default. Also, you have to instruct ifwatchd exactly how to configure the interface.Not exactly optimal.Also, several users have approached me directly in the past about dhcpcd supporting link management - I've always turned them down with the argument that the majority of Linux drivers didn't work with link management. Thankfully that's no longer the case, so dhcpcd now has link management support :DYes there are still non functioning drivers and drivers may break with link management in the future so there is an option to disable this.But it's time to adopt the BSD approach here - fix the source, in this case the driver. This was sparked by some in #netbsd asking "Where is the NetBSD equivalent of hdparm?" Well, there isn't one, because if the hardware claims it does XYZ, the software attempts to use it.For the current Gentoo users of ifplugd/netplug + dhcpcd don't panic - it still works as is :)

Discuss this Post

OK, so I spent the majority of the weekend looking after my lovely daughter, whilst my equally lovely wife was painting the lounge. This meant time on my laptop instead of playing WoW .... so I got some good coding done also.dhcpcd is now in touching distance of passing Apples Bonjour conformance test :)..... and it also works with NetworkManager svn! OK, !NetworkManager does need this patch but it's a starting point. It probably won't be merged into !NetworkManager as it stands as it's probably best to make it optional.The only thing I don't like about it is that it overrides the default script, so any user hooks aren't run. But that's an issue for another day :)EDIT: Patch is accepted upstream :D

Discuss this Post