Check rng return value when generating Transaction IDs in DHCP plugin
This commit is contained in:
committed by
Martin Willi
parent
0159a54047
commit
7ae2671036
@@ -366,7 +366,11 @@ METHOD(dhcp_socket_t, enroll, dhcp_transaction_t*,
|
||||
u_int32_t id;
|
||||
int try;
|
||||
|
||||
this->rng->get_bytes(this->rng, sizeof(id), (u_int8_t*)&id);
|
||||
if (!this->rng->get_bytes(this->rng, sizeof(id), (u_int8_t*)&id))
|
||||
{
|
||||
DBG1(DBG_CFG, "DHCP DISCOVER failed, no transaction ID");
|
||||
return NULL;
|
||||
}
|
||||
transaction = dhcp_transaction_create(id, identity);
|
||||
|
||||
this->mutex->lock(this->mutex);
|
||||
|
||||
Reference in New Issue
Block a user