[pkg-dhcp-devel] [apollock at debian.org: Old DHCP patch to exit 2 if binding fails]

Matt Zimmerman mdz at ubuntu.com
Mon Jul 13 09:51:36 UTC 2009

On Mon, Jul 13, 2009 at 02:42:14PM +1000, Andrew Pollock wrote:
> Apparently your mdz at debian.org mailbox is locked or something...

I think they deactivated it at the same time that my key was moved to the
emeritus keyring.  I assumed that was standard practice, and that I'm not
hard to find if anyone needs to reach me.

> ----- Forwarded message from Andrew Pollock <apollock at debian.org> -----
> From: Andrew Pollock <apollock at debian.org>
> To: mdz at debian.org
> Cc: peloy at debian.org, pkg-dhcp-devel at lists.alioth.debian.org
> Subject: [pkg-dhcp-devel] Old DHCP patch to exit 2 if binding fails
> Date: Mon, 13 Jul 2009 14:10:11 +1000
> User-Agent: Mutt/1.5.13 (2006-08-11)
> Hi Matt,
> I'm in the process of preparing ISC DHCP 4.1 packages for Debian, and I'm
> reviewing all of the patches.
> The first one I've happened upon is one that looks like it came from you,
> without a bug, and I'm just trying to understand the rationale behind it
> while I decide whether or not to reapply it to the 4.1 sources, and whether
> it should go upstream or not.
> The relevant debian/changelog entry says:
> - Use exit status 2, rather than 1, to indicate that binding failed, so that
>   unrelated errors do not result in DHCPDECLINE (your ISP will thank you)
> Why will my ISP thank me? Because an exit status of 1 from dhclient-script
> (I'm failing to see where this could eventuate at the moment) won't decline
> a lease? Why would my ISP care? Surely a non-zero result from
> dhclient-script means something is afoot?

The story behind this patch is that I made a mistake which resulted in
dhclient-script exiting with status 1 (I don't recall exactly how; I think
it was a typo in one of the hooks).  dhcpd interpreted this to mean that the
lease was found to be unusable, and issued DHCPDECLINE to the server.

The server immediately issued me a new lease, which triggered the same
error, and another DHCPDECLINE, ad infinitum.

...well, not quite infinitum, but it *very* quickly exhausted all available
DHCP leases, causing a local outage which I had to call my ISP and explain.

The idea of the patch was to use a distinct exit code for "this lease is no
good" which wouldn't be confused with "there was an error executing one of
the hooks".  In retrospect, 2 is probably not an ideal choice, as I think
the shell will generate that as an error exit code in some cases.

Does that help clarify things?

 - mdz

More information about the pkg-dhcp-devel mailing list