summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-dhcp4.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-07-16 03:43:49 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-07-16 03:54:16 +0200
commitf766d9af381687237fb1670bab67cf86064d0fba (patch)
tree4cb5be10ef751e0d337ed028c38228b3ad3508cb /src/network/networkd-dhcp4.c
parentnetwork: dhcp4: fix another race with SendDecline=yes (diff)
downloadsystemd-f766d9af381687237fb1670bab67cf86064d0fba.tar.xz
systemd-f766d9af381687237fb1670bab67cf86064d0fba.zip
network: dhcp4: add two warnings
Diffstat (limited to '')
-rw-r--r--src/network/networkd-dhcp4.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index f732f38567..b7a8c628fb 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -847,7 +847,9 @@ static void dhcp_address_on_acd(sd_ipv4acd *acd, int event, void *userdata) {
(void) in_addr_to_string(AF_INET, &address, &pretty);
log_link_warning(link, "DAD conflict. Dropping DHCP4 address %s", strna(pretty));
- (void) sd_dhcp_client_send_decline(link->dhcp_client);
+ r = sd_dhcp_client_send_decline(link->dhcp_client);
+ if (r < 0)
+ log_link_warning_errno(link, r, "Failed to send DHCP DECLINE, ignoring: %m");
if (link->dhcp_lease) {
r = dhcp_lease_lost(link);
@@ -1263,8 +1265,11 @@ static int dhcp4_handler(sd_dhcp_client *client, int event, void *userdata) {
}
if (link->dhcp_lease) {
- if (link->network->dhcp_send_release)
- (void) sd_dhcp_client_send_release(client);
+ if (link->network->dhcp_send_release) {
+ r = sd_dhcp_client_send_release(client);
+ if (r < 0)
+ log_link_warning_errno(link, r, "Failed to send DHCP RELEASE, ignoring: %m");
+ }
r = dhcp_lease_lost(link);
if (r < 0) {
@@ -1586,7 +1591,6 @@ int dhcp4_configure(Link *link) {
log_link_debug(link, "DHCP4 CLIENT: Failed to set request flag for '%u' already exists, ignoring.", option);
continue;
}
-
if (r < 0)
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for '%u': %m", option);
}