3b727c
--- dhcp-3.0.5/client/dhclient.c.decline	2007-03-30 15:29:58.000000000 -0400
3b727c
+++ dhcp-3.0.5/client/dhclient.c	2007-03-30 15:50:25.000000000 -0400
3b727c
@@ -934,6 +934,7 @@
3b727c
 	void *cpp;
3b727c
 {
3b727c
 	struct client_state *client = cpp;
3b727c
+	enum dhcp_state init_state = client->state;
3b727c
 
3b727c
 	ASSERT_STATE(state, S_INIT);
3b727c
 
3b727c
@@ -946,9 +947,16 @@
3b727c
 	client -> first_sending = cur_time;
3b727c
 	client -> interval = client -> config -> initial_interval;
3b727c
 
3b727c
-	/* Add an immediate timeout to cause the first DHCPDISCOVER packet
3b727c
-	   to go out. */
3b727c
-	send_discover (client);
3b727c
+	if (init_state != S_DECLINED) {
3b727c
+		/* Add an immediate timeout to cause the first DHCPDISCOVER packet
3b727c
+		   to go out. */
3b727c
+		send_discover(client);
3b727c
+	} else {
3b727c
+		/* We've received an OFFER and it has been DECLINEd by dhclient-script.
3b727c
+		 * wait for a random time between 1 and backoff_cutoff seconds before
3b727c
+		 * trying again. */
3b727c
+		add_timeout(cur_time + ((1 + (random() >> 2)) %  client->config->backoff_cutoff), send_discover, client, 0, 0);
3b727c
+	}
3b727c
 }
3b727c
 
3b727c
 /* state_selecting is called when one or more DHCPOFFER packets have been
3b727c
@@ -1215,6 +1223,7 @@
3b727c
 		send_decline (client);
3b727c
 		destroy_client_lease (client -> new);
3b727c
 		client -> new = (struct client_lease *)0;
3b727c
+		client -> state = S_DECLINED;
3b727c
 		state_init (client);
3b727c
 		return;
3b727c
 	}
3b727c
@@ -3183,6 +3192,7 @@
3b727c
 			      case S_INIT:
3b727c
 			      case S_REBINDING:
3b727c
 			      case S_STOPPED:
3b727c
+			      case S_DECLINED:
3b727c
 				break;
3b727c
 			}
3b727c
 			client -> state = S_INIT;
3b727c
--- dhcp-3.0.5/includes/dhcpd.h.decline	2007-03-30 15:30:14.000000000 -0400
3b727c
+++ dhcp-3.0.5/includes/dhcpd.h	2007-03-30 15:50:53.000000000 -0400
3b727c
@@ -704,7 +704,8 @@
3b727c
 	S_BOUND = 5,
3b727c
 	S_RENEWING = 6,
3b727c
 	S_REBINDING = 7,
3b727c
-	S_STOPPED = 8
3b727c
+	S_STOPPED = 8,
3b727c
+	S_DECLINED = 9
3b727c
 };
3b727c
 
3b727c
 /* Authentication and BOOTP policy possibilities (not all values work