2010-07-21 16:56:35 +00:00
|
|
|
diff -up dhcp-4.2.0/client/dhclient.c.initialization-delay dhcp-4.2.0/client/dhclient.c
|
|
|
|
--- dhcp-4.2.0/client/dhclient.c.initialization-delay 2010-07-21 16:16:51.000000000 +0200
|
|
|
|
+++ dhcp-4.2.0/client/dhclient.c 2010-07-21 16:22:18.000000000 +0200
|
|
|
|
@@ -949,11 +949,16 @@ main(int argc, char **argv) {
|
2010-05-03 14:44:05 +00:00
|
|
|
do_release(client);
|
|
|
|
else {
|
|
|
|
client->state = S_INIT;
|
|
|
|
- /* Set up a timeout to start the
|
|
|
|
- * initialization process.
|
|
|
|
+ /* Set up a timeout (0-1 second) to
|
|
|
|
+ * start the initialization process.
|
2010-04-29 15:24:42 +00:00
|
|
|
*/
|
|
|
|
- tv.tv_sec = cur_time + random() % 5;
|
2010-05-03 14:44:05 +00:00
|
|
|
- tv.tv_usec = 0;
|
|
|
|
+ tv.tv_sec = cur_tv.tv_sec;
|
|
|
|
+ tv.tv_usec = cur_tv.tv_usec;
|
|
|
|
+ tv.tv_usec += (random() % 100) * 10000;
|
|
|
|
+ if (tv.tv_usec >= 1000000) {
|
|
|
|
+ tv.tv_sec += 1;
|
|
|
|
+ tv.tv_usec -= 1000000;
|
|
|
|
+ }
|
2010-04-29 15:24:42 +00:00
|
|
|
add_timeout(&tv, state_reboot,
|
|
|
|
client, 0, 0);
|
2010-05-03 14:44:05 +00:00
|
|
|
}
|
2010-07-21 16:56:35 +00:00
|
|
|
@@ -3930,10 +3935,16 @@ isc_result_t dhclient_interface_startup_
|
2010-05-03 14:44:05 +00:00
|
|
|
ip -> flags |= INTERFACE_RUNNING;
|
|
|
|
for (client = ip -> client; client; client = client -> next) {
|
2010-04-29 15:24:42 +00:00
|
|
|
client -> state = S_INIT;
|
2010-05-03 14:44:05 +00:00
|
|
|
- /* Set up a timeout to start the initialization
|
|
|
|
- process. */
|
2010-04-29 15:24:42 +00:00
|
|
|
- tv . tv_sec = cur_time + random () % 5;
|
2010-05-03 14:44:05 +00:00
|
|
|
- tv . tv_usec = 0;
|
|
|
|
+ /* Set up a timeout (0-1 second) to
|
|
|
|
+ * start the initialization process.
|
|
|
|
+ */
|
|
|
|
+ tv.tv_sec = cur_tv.tv_sec;
|
|
|
|
+ tv.tv_usec = cur_tv.tv_usec;
|
|
|
|
+ tv.tv_usec += (random() % 100) * 10000;
|
|
|
|
+ if (tv.tv_usec >= 1000000) {
|
|
|
|
+ tv.tv_sec += 1;
|
|
|
|
+ tv.tv_usec -= 1000000;
|
|
|
|
+ }
|
2010-04-29 15:24:42 +00:00
|
|
|
add_timeout (&tv, state_reboot, client, 0, 0);
|
|
|
|
}
|
2010-05-03 14:44:05 +00:00
|
|
|
}
|