network: introduce system wide default setting for DHCPv4 client ID
Typically, the same client identifier setting is used for all interfaces. Hence, better to provide the system-wide setting to specify the client identifier.
This commit is contained in:
@@ -52,7 +52,7 @@ void network_adjust_dhcp4(Network *network) {
|
||||
}
|
||||
|
||||
if (network->dhcp_client_identifier < 0)
|
||||
network->dhcp_client_identifier = network->dhcp_anonymize ? DHCP_CLIENT_ID_MAC : DHCP_CLIENT_ID_DUID;
|
||||
network->dhcp_client_identifier = network->dhcp_anonymize ? DHCP_CLIENT_ID_MAC : network->manager->dhcp_client_identifier;
|
||||
|
||||
/* By default, RapidCommit= is enabled when Anonymize=no and neither AllowList= nor DenyList= is specified. */
|
||||
if (network->dhcp_use_rapid_commit < 0)
|
||||
|
||||
@@ -37,6 +37,7 @@ IPv6AcceptRA.UseDomains, config_parse_use_domains,
|
||||
IPv6AddressLabel.Prefix, config_parse_ipv6_address_label_section, IPV6_ADDRESS_LABEL_BY_MANAGER | IPV6_ADDRESS_LABEL_PREFIX, 0
|
||||
IPv6AddressLabel.Label, config_parse_ipv6_address_label_section, IPV6_ADDRESS_LABEL_BY_MANAGER | IPV6_ADDRESS_LABEL, 0
|
||||
DHCPv4.UseDomains, config_parse_use_domains, 0, offsetof(Manager, dhcp_use_domains)
|
||||
DHCPv4.ClientIdentifier, config_parse_dhcp_client_identifier, 0, offsetof(Manager, dhcp_client_identifier)
|
||||
DHCPv4.DUIDType, config_parse_duid_type, 0, offsetof(Manager, dhcp_duid)
|
||||
DHCPv4.DUIDRawData, config_parse_duid_rawdata, 0, offsetof(Manager, dhcp_duid)
|
||||
DHCPv6.UseDomains, config_parse_use_domains, 0, offsetof(Manager, dhcp6_use_domains)
|
||||
|
||||
@@ -647,6 +647,7 @@ int manager_new(Manager **ret, bool test_mode) {
|
||||
.dhcp_use_domains = _USE_DOMAINS_INVALID,
|
||||
.dhcp6_use_domains = _USE_DOMAINS_INVALID,
|
||||
.ndisc_use_domains = _USE_DOMAINS_INVALID,
|
||||
.dhcp_client_identifier = DHCP_CLIENT_ID_DUID,
|
||||
.dhcp_duid.type = DUID_TYPE_EN,
|
||||
.dhcp6_duid.type = DUID_TYPE_EN,
|
||||
.duid_product_uuid.type = DUID_TYPE_UUID,
|
||||
|
||||
@@ -78,6 +78,7 @@ struct Manager {
|
||||
UseDomains dhcp6_use_domains;
|
||||
UseDomains ndisc_use_domains;
|
||||
|
||||
DHCPClientIdentifier dhcp_client_identifier;
|
||||
DUID dhcp_duid;
|
||||
DUID dhcp6_duid;
|
||||
DUID duid_product_uuid;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#UseDomains=
|
||||
|
||||
[DHCPv4]
|
||||
#ClientIdentifier=duid
|
||||
#DUIDType=vendor
|
||||
#DUIDRawData=
|
||||
#UseDomains=
|
||||
|
||||
Reference in New Issue
Block a user