diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-11-01 15:52:58 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-11-02 14:42:01 +0100 |
commit | fecd205d3e68b068352534d83f96bf2324739926 (patch) | |
tree | fda12d9cad4f301a971c7f3940ae198a9cd54e4d /src/network/networkd-dhcp4.c | |
parent | machine: introduce io.systemd.MachineImage.{Clone, Remove} methods (#34853) (diff) | |
download | systemd-fecd205d3e68b068352534d83f96bf2324739926.tar.xz systemd-fecd205d3e68b068352534d83f96bf2324739926.zip |
network/dhcp4: do not restart IPv4LL client when KeepConfiguration=dhcp
When KeepConfiguration=dhcp, we do not remove acquired address, hence
not necessary to restart IPv4LL client.
Diffstat (limited to '')
-rw-r--r-- | src/network/networkd-dhcp4.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index bda3a561d9..19b9a3ecba 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -1168,6 +1168,11 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) { switch (event) { case SD_DHCP_CLIENT_EVENT_STOP: + if (FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP)) { + log_link_notice(link, "DHCPv4 connection considered critical, ignoring request to reconfigure it."); + return 0; + } + if (link->ipv4ll) { log_link_debug(link, "DHCP client is stopped. Acquiring IPv4 link-local address"); @@ -1182,11 +1187,6 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) { return log_link_warning_errno(link, r, "Could not acquire IPv4 link-local address: %m"); } - if (FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP)) { - log_link_notice(link, "DHCPv4 connection considered critical, ignoring request to reconfigure it."); - return 0; - } - if (link->dhcp_lease) { if (link->network->dhcp_send_release) { r = sd_dhcp_client_send_release(client); |