if (network->dhcp_use_gateway < 0)
network->dhcp_use_gateway = network->dhcp_use_routes;
- if (network->dhcp_anonymize) {
- /* RFC7844 section 3.: MAY contain the Client Identifier option
- * Section 3.5: clients MUST use client identifiers based solely on the link-layer address
- * NOTE: Using MAC, as it does not reveal extra information, and some servers might not
- * answer if this option is not sent */
+ /* RFC7844 section 3.: MAY contain the Client Identifier option
+ * Section 3.5: clients MUST use client identifiers based solely on the link-layer address
+ * NOTE: Using MAC, as it does not reveal extra information, and some servers might not answer
+ * if this option is not sent */
+ if (network->dhcp_anonymize &&
+ network->dhcp_client_identifier >= 0 &&
+ network->dhcp_client_identifier != DHCP_CLIENT_ID_MAC) {
+ log_warning("%s: ClientIdentifier= is set, although Anonymize=yes. Using ClientIdentifier=mac.",
+ network->filename);
network->dhcp_client_identifier = DHCP_CLIENT_ID_MAC;
}
+
+ if (network->dhcp_client_identifier < 0)
+ network->dhcp_client_identifier = network->dhcp_anonymize ? DHCP_CLIENT_ID_MAC : DHCP_CLIENT_ID_DUID;
}
static int dhcp4_release_old_lease(Link *link) {
.dhcp_send_hostname = true,
.dhcp_send_release = true,
.dhcp_route_metric = DHCP_ROUTE_METRIC,
- /* NOTE: this var might be overwritten by network_adjust_dhcp4() */
- .dhcp_client_identifier = DHCP_CLIENT_ID_DUID,
+ .dhcp_client_identifier = _DHCP_CLIENT_ID_INVALID,
.dhcp_route_table = RT_TABLE_MAIN,
.dhcp_ip_service_type = -1,