summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/sd-dhcp-client.c
diff options
context:
space:
mode:
authorpelaufer <paul@laufernet.com>2023-09-02 22:46:47 +0200
committerpelaufer <paul@laufernet.com>2023-09-02 22:46:47 +0200
commit8412d4c878a3770d8852812e9088b0122ccdd1b3 (patch)
treedfc125318dcd1e577d892781090a18d3e24f65d9 /src/libsystemd-network/sd-dhcp-client.c
parentAdding client_set_state to sd-dhcp-client.c to support a client state change ... (diff)
downloadsystemd-8412d4c878a3770d8852812e9088b0122ccdd1b3.tar.xz
systemd-8412d4c878a3770d8852812e9088b0122ccdd1b3.zip
Adding dhcp_state_to_string and dhcp client state change logging
Diffstat (limited to '')
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index cbea55dd63..2e17f3cfd5 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -736,6 +736,9 @@ static void client_set_state(sd_dhcp_client *client, DHCPState state) {
if (client->state == state)
return;
+ log_dhcp_client(client, "State changed: %s -> %s",
+ dhcp_state_to_string(client->state), dhcp_state_to_string(state));
+
client->state = state;
}
@@ -1192,6 +1195,7 @@ static int client_send_request(sd_dhcp_client *client) {
case DHCP_STATE_REBOOTING:
case DHCP_STATE_BOUND:
case DHCP_STATE_STOPPED:
+ default:
return -EINVAL;
}
@@ -1349,6 +1353,7 @@ static int client_timeout_resend(
break;
case DHCP_STATE_STOPPED:
+ default:
r = -EINVAL;
goto error;
}