2010-01-20 17:07:47 +00:00
|
|
|
diff -up dhcp-4.1.1/client/dhclient.c.inherit dhcp-4.1.1/client/dhclient.c
|
|
|
|
--- dhcp-4.1.1/client/dhclient.c.inherit 2010-01-20 17:22:34.000000000 +0100
|
|
|
|
+++ dhcp-4.1.1/client/dhclient.c 2010-01-20 17:22:34.000000000 +0100
|
|
|
|
@@ -2301,6 +2301,7 @@ void send_request (cpp)
|
2008-08-01 22:16:38 +00:00
|
|
|
{
|
|
|
|
struct client_state *client = cpp;
|
|
|
|
|
|
|
|
+ int i;
|
|
|
|
int result;
|
|
|
|
int interval;
|
|
|
|
struct sockaddr_in destination;
|
2010-01-20 17:07:47 +00:00
|
|
|
@@ -2360,6 +2361,22 @@ void send_request (cpp)
|
2008-08-01 21:16:41 +00:00
|
|
|
/* Now do a preinit on the interface so that we can
|
|
|
|
discover a new address. */
|
|
|
|
script_init (client, "PREINIT", (struct string_list *)0);
|
2008-08-01 22:16:38 +00:00
|
|
|
+
|
2008-08-01 21:16:41 +00:00
|
|
|
+ /* Has an active lease */
|
2008-08-01 22:16:38 +00:00
|
|
|
+ if (client -> interface -> addresses != NULL) {
|
|
|
|
+ for (i = 0; i < client -> interface -> address_count; i++) {
|
|
|
|
+ if (client -> active &&
|
|
|
|
+ client -> active -> is_bootp &&
|
|
|
|
+ client -> active -> expiry > cur_time &&
|
|
|
|
+ client -> interface -> addresses[i].s_addr != 0 &&
|
|
|
|
+ client -> active -> address.len == 4 &&
|
|
|
|
+ memcpy (client -> active -> address.iabuf, &(client -> interface -> addresses[i]), 4) == 0) {
|
|
|
|
+ client_envadd (client, "", "keep_old_ip", "%s", "yes");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2008-08-01 21:16:41 +00:00
|
|
|
if (client -> alias)
|
|
|
|
script_write_params (client, "alias_",
|
|
|
|
client -> alias);
|