76 lines
2.6 KiB
Diff
76 lines
2.6 KiB
Diff
|
diff -up dhcp-4.1.1/client/dhc6.c.retransmission dhcp-4.1.1/client/dhc6.c
|
||
|
--- dhcp-4.1.1/client/dhc6.c.retransmission 2010-03-25 18:32:17.000000000 +0100
|
||
|
+++ dhcp-4.1.1/client/dhc6.c 2010-03-25 18:33:54.000000000 +0100
|
||
|
@@ -354,7 +354,7 @@ dhc6_retrans_init(struct client_state *c
|
||
|
static void
|
||
|
dhc6_retrans_advance(struct client_state *client)
|
||
|
{
|
||
|
- struct timeval elapsed;
|
||
|
+ struct timeval elapsed, elapsed_after_RT;
|
||
|
|
||
|
/* elapsed = cur - start */
|
||
|
elapsed.tv_sec = cur_tv.tv_sec - client->start_time.tv_sec;
|
||
|
@@ -371,6 +371,8 @@ dhc6_retrans_advance(struct client_state
|
||
|
elapsed.tv_sec += 1;
|
||
|
elapsed.tv_usec -= 1000000;
|
||
|
}
|
||
|
+ elapsed_after_RT.tv_sec = elapsed.tv_sec;
|
||
|
+ elapsed_after_RT.tv_usec = elapsed.tv_usec;
|
||
|
|
||
|
/*
|
||
|
* RT for each subsequent message transmission is based on the previous
|
||
|
@@ -408,13 +410,10 @@ dhc6_retrans_advance(struct client_state
|
||
|
elapsed.tv_usec -= 1000000;
|
||
|
}
|
||
|
if (elapsed.tv_sec >= client->MRD) {
|
||
|
- /*
|
||
|
- * wake at RT + cur = start + MRD
|
||
|
- */
|
||
|
- client->RT = client->MRD +
|
||
|
- (client->start_time.tv_sec - cur_tv.tv_sec);
|
||
|
- client->RT = client->RT * 100 +
|
||
|
- (client->start_time.tv_usec - cur_tv.tv_usec) / 10000;
|
||
|
+ client->RT = client->MRD - elapsed_after_RT.tv_sec;
|
||
|
+ client->RT = client->RT * 100 - elapsed_after_RT.tv_usec / 10000;
|
||
|
+ if (client->RT < 0)
|
||
|
+ client->RT = 0;
|
||
|
}
|
||
|
client->txcount++;
|
||
|
}
|
||
|
@@ -1502,7 +1501,7 @@ do_init6(void *input)
|
||
|
elapsed.tv_usec += 1000000;
|
||
|
}
|
||
|
/* Check if finished (-1 argument). */
|
||
|
- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) {
|
||
|
+ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) {
|
||
|
log_info("Max retransmission duration exceeded.");
|
||
|
client->state = S_STOPPED;
|
||
|
if (client->active_lease != NULL) {
|
||
|
@@ -1922,7 +1921,7 @@ do_info_request6(void *input)
|
||
|
elapsed.tv_usec += 1000000;
|
||
|
}
|
||
|
/* Check if finished (-1 argument). */
|
||
|
- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) {
|
||
|
+ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) {
|
||
|
log_info("Max retransmission duration exceeded.");
|
||
|
exit(2);
|
||
|
}
|
||
|
@@ -2043,7 +2042,7 @@ do_confirm6(void *input)
|
||
|
elapsed.tv_sec -= 1;
|
||
|
elapsed.tv_usec += 1000000;
|
||
|
}
|
||
|
- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) {
|
||
|
+ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) {
|
||
|
log_info("Max retransmission duration exceeded.");
|
||
|
start_bound(client);
|
||
|
return;
|
||
|
@@ -3290,7 +3289,7 @@ do_select6(void *input)
|
||
|
elapsed.tv_sec -= 1;
|
||
|
elapsed.tv_usec += 1000000;
|
||
|
}
|
||
|
- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) {
|
||
|
+ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) {
|
||
|
log_info("Max retransmission duration exceeded.");
|
||
|
abort = ISC_TRUE;
|
||
|
}
|