philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/dhcp-4.2.3-dhclient-decline-onetry.patch

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