49 lines
1.7 KiB
Diff
49 lines
1.7 KiB
Diff
diff -up dhcp-4.3.0a1/client/dhc6.c.retransmission dhcp-4.3.0a1/client/dhc6.c
|
|
--- dhcp-4.3.0a1/client/dhc6.c.retransmission 2013-12-19 15:57:09.629945386 +0100
|
|
+++ dhcp-4.3.0a1/client/dhc6.c 2013-12-19 15:57:09.634945316 +0100
|
|
@@ -302,7 +302,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;
|
|
@@ -319,6 +319,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
|
|
@@ -356,13 +358,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++;
|
|
}
|
|
@@ -1439,7 +1438,7 @@ check_timing6 (struct client_state *clie
|
|
}
|
|
|
|
/* 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.");
|
|
return(CHK_TIM_MRD_EXCEEDED);
|
|
}
|