dhcp/dhcp-dhclient-decline-onetry.patch
2013-12-20 16:19:14 +01:00

28 lines
911 B
Diff

diff -up dhcp-4.3.0a1/client/dhclient.c.decline-onetry dhcp-4.3.0a1/client/dhclient.c
--- dhcp-4.3.0a1/client/dhclient.c.decline-onetry 2013-12-20 13:37:26.382796437 +0100
+++ dhcp-4.3.0a1/client/dhclient.c 2013-12-20 13:37:26.401796172 +0100
@@ -1708,11 +1708,18 @@ void bind_lease (client)
if (script_go (client)) {
make_decline (client, client -> new);
send_decline (client);
- destroy_client_lease (client -> new);
- client -> new = (struct client_lease *)0;
- client -> state = S_DECLINED;
- state_init (client);
- return;
+ if (onetry) {
+ if (!quiet)
+ log_info ("Unable to obtain a lease on first try.%s",
+ " Exiting.");
+ exit (2);
+ } else {
+ destroy_client_lease (client -> new);
+ client -> new = (struct client_lease *)0;
+ client -> state = S_DECLINED;
+ state_init (client);
+ return;
+ }
}
/* Write out the new lease if it has been long enough. */