diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-10-04 23:53:01 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-10-04 23:56:51 +0200 |
commit | 5d896defeb7a9c65de63515eb87542bf8d7c04e2 (patch) | |
tree | 1b7d042481a7b6b1eeef661ff62e4b24cb370921 /src/network | |
parent | docs: fix typo in UEFI_SECURITY.md (diff) | |
download | systemd-5d896defeb7a9c65de63515eb87542bf8d7c04e2.tar.xz systemd-5d896defeb7a9c65de63515eb87542bf8d7c04e2.zip |
network: skip to set request address when anonymized
In sd-dhcp-client.c, we do not set the option in the DHCPDISCOVER
message when anonymized, and the specified address is ignored
anyway. So, this does not change the behavior, but suppress
misleading debugging log in dhcp4_set_request_address().
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-dhcp4.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index f14e62588f..2a6237c6d5 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -1487,6 +1487,10 @@ static int dhcp4_configure(Link *link) { } if (!link->network->dhcp_anonymize) { + r = dhcp4_set_request_address(link); + if (r < 0) + return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set initial DHCPv4 address: %m"); + if (link->network->dhcp_use_mtu) { r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_MTU_INTERFACE); if (r < 0) @@ -1616,10 +1620,6 @@ static int dhcp4_configure(Link *link) { return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed set to lease lifetime: %m"); } - r = dhcp4_set_request_address(link); - if (r < 0) - return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to set initial DHCPv4 address: %m"); - return dhcp4_set_client_identifier(link); } |