2
0
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:
David Hankins 2007-11-20 21:07:12 +00:00
parent b024480eba
commit c0216cb7c9
2 changed files with 21 additions and 29 deletions

View File

@ -69,6 +69,9 @@ suggested fixes to <dhcp-users@isc.org>.
address per IA by default, which can be adjusted through the address per IA by default, which can be adjusted through the
"limit-addrs-per-ia" configuration option. "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 Changes since 4.0.0b2
- Clarified error message when lease limit exceeded - Clarified error message when lease limit exceeded

View File

@ -249,33 +249,34 @@ dhc6_rand(TIME base)
return rval; 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 static void
dhc6_new_xid(struct client_state *client) dhc6_retrans_init(struct client_state *client)
{ {
int xid; int xid;
if (RAND_MAX >= 0x00ffffff) /* Initialize timers. */
xid = random(); client->start_time = cur_time;
else if (RAND_MAX >= 0x0000ffff) client->txcount = 0;
xid = (random() << 16) | random(); client->RT = client->IRT + dhc6_rand(client->IRT);
else
xid = (random() << 24) | (random() << 16) | random(); /* Generate a new random 24-bit transaction ID for this exchange. */
#if (RAND_MAX >= 0x00ffffff)
xid = 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[0] = (xid >> 16) & 0xff;
client->dhcpv6_transaction_id[1] = (xid >> 8) & 0xff; client->dhcpv6_transaction_id[1] = (xid >> 8) & 0xff;
client->dhcpv6_transaction_id[2] = xid & 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. */ /* Advance the DHCPv6 retransmission state once. */
static void static void
dhc6_retrans_advance(struct client_state *client) dhc6_retrans_advance(struct client_state *client)
@ -857,9 +858,6 @@ start_init6(struct client_state *client)
log_debug("PRC: Soliciting for leases (INIT)."); log_debug("PRC: Soliciting for leases (INIT).");
client->state = S_INIT; client->state = S_INIT;
/* Fetch a 24-bit transaction ID. */
dhc6_new_xid(client);
/* Initialize timers, RFC3315 section 17.1.2. */ /* Initialize timers, RFC3315 section 17.1.2. */
client->IRT = SOL_TIMEOUT; client->IRT = SOL_TIMEOUT;
client->MRT = SOL_MAX_RT; client->MRT = SOL_MAX_RT;
@ -904,9 +902,6 @@ start_confirm6(struct client_state *client)
log_debug("PRC: Confirming active lease (INIT-REBOOT)."); log_debug("PRC: Confirming active lease (INIT-REBOOT).");
client->state = S_REBOOTING; client->state = S_REBOOTING;
/* Fetch a 24-bit transaction ID. */
dhc6_new_xid(client);
/* Initialize timers, RFC3315 section 17.1.3. */ /* Initialize timers, RFC3315 section 17.1.3. */
client->IRT = CNF_TIMEOUT; client->IRT = CNF_TIMEOUT;
client->MRT = CNF_MAX_RT; client->MRT = CNF_MAX_RT;
@ -1210,9 +1205,6 @@ start_release6(struct client_state *client)
*/ */
unconfigure6(client, "RELEASE6"); unconfigure6(client, "RELEASE6");
/* Fetch a 24-bit transaction ID. */
dhc6_new_xid(client);
/* Set timers per RFC3315 section 18.1.1. */ /* Set timers per RFC3315 section 18.1.1. */
client->IRT = REL_TIMEOUT; client->IRT = REL_TIMEOUT;
client->MRT = 0; client->MRT = 0;
@ -1983,9 +1975,6 @@ start_selecting6(struct client_state *client)
client->selected_lease = lease; client->selected_lease = lease;
/* Fetch a 24-bit transaction ID. */
dhc6_new_xid(client);
/* Set timers per RFC3315 section 18.1.1. */ /* Set timers per RFC3315 section 18.1.1. */
client->IRT = REQ_TIMEOUT; client->IRT = REQ_TIMEOUT;
client->MRT = REQ_MAX_RT; client->MRT = REQ_MAX_RT;