mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-22 09:57:20 +00:00
- The DHCPv6 client now issues fresh transaction IDs on Renew and Rebind
message exchanges, rather than using the most recent ID. [ISC-Bugs #17300]
This commit is contained in:
parent
b024480eba
commit
c0216cb7c9
3
RELNOTES
3
RELNOTES
@ -69,6 +69,9 @@ suggested fixes to <dhcp-users@isc.org>.
|
||||
address per IA by default, which can be adjusted through the
|
||||
"limit-addrs-per-ia" configuration option.
|
||||
|
||||
- The DHCPv6 client now issues fresh transaction IDs on Renew and Rebind
|
||||
message exchanges, rather than using the most recent ID.
|
||||
|
||||
Changes since 4.0.0b2
|
||||
|
||||
- Clarified error message when lease limit exceeded
|
||||
|
@ -249,33 +249,34 @@ dhc6_rand(TIME base)
|
||||
return rval;
|
||||
}
|
||||
|
||||
/* Get a new dhcpv6_transaction_id and store it to the client state. */
|
||||
/* Initialize message exchange timers (set RT from Initial-RT). */
|
||||
static void
|
||||
dhc6_new_xid(struct client_state *client)
|
||||
dhc6_retrans_init(struct client_state *client)
|
||||
{
|
||||
int xid;
|
||||
|
||||
if (RAND_MAX >= 0x00ffffff)
|
||||
/* Initialize timers. */
|
||||
client->start_time = cur_time;
|
||||
client->txcount = 0;
|
||||
client->RT = client->IRT + dhc6_rand(client->IRT);
|
||||
|
||||
/* Generate a new random 24-bit transaction ID for this exchange. */
|
||||
|
||||
#if (RAND_MAX >= 0x00ffffff)
|
||||
xid = random();
|
||||
else if (RAND_MAX >= 0x0000ffff)
|
||||
xid = (random() << 16) | random();
|
||||
else
|
||||
xid = (random() << 24) | (random() << 16) | random();
|
||||
#elif (RAND_MAX >= 0x0000ffff)
|
||||
xid = (random() << 16) ^ random();
|
||||
#elif (RAND_MAX >= 0x000000ff)
|
||||
xid = (random() << 16) ^ (random() << 8) ^ random();
|
||||
#else
|
||||
# error "Random number generator of less than 8 bits not supported."
|
||||
#endif
|
||||
|
||||
client->dhcpv6_transaction_id[0] = (xid >> 16) & 0xff;
|
||||
client->dhcpv6_transaction_id[1] = (xid >> 8) & 0xff;
|
||||
client->dhcpv6_transaction_id[2] = xid & 0xff;
|
||||
}
|
||||
|
||||
/* Set RT from initial RT. */
|
||||
static void
|
||||
dhc6_retrans_init(struct client_state *client)
|
||||
{
|
||||
client->start_time = cur_time;
|
||||
client->txcount = 0;
|
||||
client->RT = client->IRT + dhc6_rand(client->IRT);
|
||||
}
|
||||
|
||||
/* Advance the DHCPv6 retransmission state once. */
|
||||
static void
|
||||
dhc6_retrans_advance(struct client_state *client)
|
||||
@ -857,9 +858,6 @@ start_init6(struct client_state *client)
|
||||
log_debug("PRC: Soliciting for leases (INIT).");
|
||||
client->state = S_INIT;
|
||||
|
||||
/* Fetch a 24-bit transaction ID. */
|
||||
dhc6_new_xid(client);
|
||||
|
||||
/* Initialize timers, RFC3315 section 17.1.2. */
|
||||
client->IRT = SOL_TIMEOUT;
|
||||
client->MRT = SOL_MAX_RT;
|
||||
@ -904,9 +902,6 @@ start_confirm6(struct client_state *client)
|
||||
log_debug("PRC: Confirming active lease (INIT-REBOOT).");
|
||||
client->state = S_REBOOTING;
|
||||
|
||||
/* Fetch a 24-bit transaction ID. */
|
||||
dhc6_new_xid(client);
|
||||
|
||||
/* Initialize timers, RFC3315 section 17.1.3. */
|
||||
client->IRT = CNF_TIMEOUT;
|
||||
client->MRT = CNF_MAX_RT;
|
||||
@ -1210,9 +1205,6 @@ start_release6(struct client_state *client)
|
||||
*/
|
||||
unconfigure6(client, "RELEASE6");
|
||||
|
||||
/* Fetch a 24-bit transaction ID. */
|
||||
dhc6_new_xid(client);
|
||||
|
||||
/* Set timers per RFC3315 section 18.1.1. */
|
||||
client->IRT = REL_TIMEOUT;
|
||||
client->MRT = 0;
|
||||
@ -1983,9 +1975,6 @@ start_selecting6(struct client_state *client)
|
||||
|
||||
client->selected_lease = lease;
|
||||
|
||||
/* Fetch a 24-bit transaction ID. */
|
||||
dhc6_new_xid(client);
|
||||
|
||||
/* Set timers per RFC3315 section 18.1.1. */
|
||||
client->IRT = REQ_TIMEOUT;
|
||||
client->MRT = REQ_MAX_RT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user