dhcp: Only send client identifier if identity_lease is enabled

The client identifier serves as unique identifier just like a unique MAC
address would, so even with identity_leases disabled some DHCP servers
might assign unique leases per identity.
This commit is contained in:
Tobias Brunner
2018-05-18 18:04:01 +02:00
parent 0e5b94d038
commit 7b660944b6
5 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -268,7 +268,8 @@ static int prepare_dhcp(private_dhcp_socket_t *this,
remaining -= sizeof(dhcp_option_t) + option->len;
}
if (remaining >= sizeof(dhcp_option_t) + 2)
if (this->identity_lease &&
remaining >= sizeof(dhcp_option_t) + 2)
{
option = (dhcp_option_t*)&dhcp->options[optlen];
option->type = DHCP_CLIENT_ID;