3161ff3
diff -up dhcp-4.1.0/client/dhclient.c.backoff dhcp-4.1.0/client/dhclient.c
3161ff3
--- dhcp-4.1.0/client/dhclient.c.backoff	2009-01-06 10:08:07.000000000 -1000
3161ff3
+++ dhcp-4.1.0/client/dhclient.c	2009-01-06 10:10:27.000000000 -1000
3161ff3
@@ -1185,6 +1185,7 @@ void state_init (cpp)
8273327
 	void *cpp;
8273327
 {
8273327
 	struct client_state *client = cpp;
8273327
+	enum dhcp_state init_state = client->state;
8273327
 
8273327
 	ASSERT_STATE(state, S_INIT);
8273327
 
3161ff3
@@ -1197,9 +1198,16 @@ void state_init (cpp)
8273327
 	client -> first_sending = cur_time;
8273327
 	client -> interval = client -> config -> initial_interval;
8273327
 
8273327
-	/* Add an immediate timeout to cause the first DHCPDISCOVER packet
8273327
-	   to go out. */
8273327
-	send_discover (client);
8273327
+	if (init_state != S_DECLINED) {
8273327
+		/* Add an immediate timeout to cause the first DHCPDISCOVER packet
8273327
+		   to go out. */
8273327
+		send_discover(client);
8273327
+	} else {
8273327
+		/* We've received an OFFER and it has been DECLINEd by dhclient-script.
8273327
+		 * wait for a random time between 1 and backoff_cutoff seconds before
8273327
+		 * trying again. */
8273327
+		add_timeout(cur_time + ((1 + (random() >> 2)) %  client->config->backoff_cutoff), send_discover, client, 0, 0);
8273327
+	}
8273327
 }
8273327
 
3161ff3
 /*
3161ff3
@@ -1478,6 +1486,7 @@ void bind_lease (client)
8273327
 		send_decline (client);
8273327
 		destroy_client_lease (client -> new);
8273327
 		client -> new = (struct client_lease *)0;
8273327
+		client -> state = S_DECLINED;
8273327
 		state_init (client);
8273327
 		return;
8273327
 	}
3161ff3
@@ -3680,6 +3689,7 @@ void client_location_changed ()
8273327
 			      case S_INIT:
8273327
 			      case S_REBINDING:
8273327
 			      case S_STOPPED:
8273327
+			      case S_DECLINED:
8273327
 				break;
8273327
 			}
8273327
 			client -> state = S_INIT;
3161ff3
diff -up dhcp-4.1.0/includes/dhcpd.h.backoff dhcp-4.1.0/includes/dhcpd.h
3161ff3
--- dhcp-4.1.0/includes/dhcpd.h.backoff	2009-01-06 10:08:07.000000000 -1000
3161ff3
+++ dhcp-4.1.0/includes/dhcpd.h	2009-01-06 10:08:07.000000000 -1000
3161ff3
@@ -1016,7 +1016,8 @@ enum dhcp_state {
8273327
 	S_BOUND = 5,
8273327
 	S_RENEWING = 6,
8273327
 	S_REBINDING = 7,
8273327
-	S_STOPPED = 8
8273327
+	S_STOPPED = 8,
8273327
+	S_DECLINED = 9
8273327
 };
8273327
 
8273327
 /* Authentication and BOOTP policy possibilities (not all values work