f3cba52
diff -up dhcp-4.2.3/client/dhclient.c.decline-onetry dhcp-4.2.3/client/dhclient.c
f3cba52
--- dhcp-4.2.3/client/dhclient.c.decline-onetry	2011-11-24 14:21:50.000000000 +0100
f3cba52
+++ dhcp-4.2.3/client/dhclient.c	2011-11-24 14:23:44.472893215 +0100
f3cba52
@@ -1704,11 +1704,18 @@ void bind_lease (client)
f3cba52
 	if (script_go (client)) {
f3cba52
 		make_decline (client, client -> new);
f3cba52
 		send_decline (client);
f3cba52
-		destroy_client_lease (client -> new);
f3cba52
-		client -> new = (struct client_lease *)0;
f3cba52
-		client -> state = S_DECLINED;
f3cba52
-		state_init (client);
f3cba52
-		return;
f3cba52
+		if (onetry) {
f3cba52
+			if (!quiet)
f3cba52
+			  log_info ("Unable to obtain a lease on first try.%s",
f3cba52
+					"  Exiting.");
f3cba52
+			exit (2);
f3cba52
+		} else {
f3cba52
+			destroy_client_lease (client -> new);
f3cba52
+			client -> new = (struct client_lease *)0;
f3cba52
+			client -> state = S_DECLINED;
f3cba52
+			state_init (client);
f3cba52
+			return;
f3cba52
+		}
f3cba52
 	}
f3cba52
 
f3cba52
 	/* Write out the new lease if it has been long enough. */