|
|
4bf24c8 |
diff -up dhcp-4.1.0/client/dhclient.c.inherit dhcp-4.1.0/client/dhclient.c
|
|
|
4bf24c8 |
--- dhcp-4.1.0/client/dhclient.c.inherit 2009-01-06 12:08:56.000000000 -1000
|
|
|
4bf24c8 |
+++ dhcp-4.1.0/client/dhclient.c 2009-01-06 12:08:57.000000000 -1000
|
|
|
4bf24c8 |
@@ -2299,6 +2299,7 @@ void send_request (cpp)
|
|
|
f669e74 |
{
|
|
|
f669e74 |
struct client_state *client = cpp;
|
|
|
f669e74 |
|
|
|
f669e74 |
+ int i;
|
|
|
f669e74 |
int result;
|
|
|
f669e74 |
int interval;
|
|
|
f669e74 |
struct sockaddr_in destination;
|
|
|
4bf24c8 |
@@ -2358,6 +2359,22 @@ void send_request (cpp)
|
|
|
ddfb139 |
/* Now do a preinit on the interface so that we can
|
|
|
ddfb139 |
discover a new address. */
|
|
|
ddfb139 |
script_init (client, "PREINIT", (struct string_list *)0);
|
|
|
f669e74 |
+
|
|
|
ddfb139 |
+ /* Has an active lease */
|
|
|
f669e74 |
+ if (client -> interface -> addresses != NULL) {
|
|
|
f669e74 |
+ for (i = 0; i < client -> interface -> address_count; i++) {
|
|
|
f669e74 |
+ if (client -> active &&
|
|
|
f669e74 |
+ client -> active -> is_bootp &&
|
|
|
f669e74 |
+ client -> active -> expiry > cur_time &&
|
|
|
f669e74 |
+ client -> interface -> addresses[i].s_addr != 0 &&
|
|
|
f669e74 |
+ client -> active -> address.len == 4 &&
|
|
|
f669e74 |
+ memcpy (client -> active -> address.iabuf, &(client -> interface -> addresses[i]), 4) == 0) {
|
|
|
f669e74 |
+ client_envadd (client, "", "keep_old_ip", "%s", "yes");
|
|
|
f669e74 |
+ break;
|
|
|
f669e74 |
+ }
|
|
|
f669e74 |
+ }
|
|
|
f669e74 |
+ }
|
|
|
f669e74 |
+
|
|
|
ddfb139 |
if (client -> alias)
|
|
|
ddfb139 |
script_write_params (client, "alias_",
|
|
|
ddfb139 |
client -> alias);
|