diff --git a/src/n-dhcp4/src/n-dhcp4-c-probe.c b/src/n-dhcp4/src/n-dhcp4-c-probe.c index ee3a8886bd..c37f1e207b 100644 --- a/src/n-dhcp4/src/n-dhcp4-c-probe.c +++ b/src/n-dhcp4/src/n-dhcp4-c-probe.c @@ -1332,6 +1332,10 @@ int n_dhcp4_client_probe_release(NDhcp4ClientProbe *probe) { _c_cleanup_(n_dhcp4_outgoing_freep) NDhcp4Outgoing *request_out = NULL; int r; + if (probe->connection.state != N_DHCP4_C_CONNECTION_STATE_DRAINING + && probe->connection.state != N_DHCP4_C_CONNECTION_STATE_UDP) + return -ENOTRECOVERABLE; + r = n_dhcp4_c_connection_release_new(&probe->connection, &request_out, NULL); if (r) return r;