#! /bin/sh /usr/share/dpatch/dpatch-run
## dhclient-onetry-call-clientscript.dpatch by Martin Pitt <martin.pitt@ubuntu.com>
##
## DP: Call 'dhclient-script FAIL' when failing to get an address also when
## DP: operating in oneshot mode (-1). This fixes avahi-autoipd invocation
## DP: through dhcdbd. (Debian #486520)

@DPATCH@
Index: isc-dhcp/client/dhclient.c
===================================================================
--- isc-dhcp.orig/client/dhclient.c	2012-06-22 15:00:30.974621722 -0400
+++ isc-dhcp/client/dhclient.c	2012-06-22 15:04:05.774627714 -0400
@@ -2019,6 +2019,8 @@
 		if (!quiet)
 			log_info ("Unable to obtain a lease on first try.%s",
 				  "  Exiting.");
+		script_init (client, "FAIL", (struct string_list *)0);
+		script_go (client);
 		exit (2);
 	}
 
