about summary refs log tree commit diff
path: root/src/n-dhcp4
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2025-01-20 19:08:06 +0100
committerMichael Biebl <biebl@debian.org>2025-01-20 19:08:06 +0100
commit818258cf34b83fbc754633295e1052d4752d7b15 (patch)
treeaa45b6a831d6c0ee954b1a03891ad3da09349528 /src/n-dhcp4
parente465722b908aa870bdc293b9a417d3c15294aa6d (diff)
New upstream version 1.50.2 upstream/1.50.2
Diffstat (limited to 'src/n-dhcp4')
-rw-r--r--src/n-dhcp4/src/n-dhcp4-c-connection.c6
-rw-r--r--src/n-dhcp4/src/n-dhcp4-c-probe.c8
-rw-r--r--src/n-dhcp4/src/n-dhcp4-private.h3
3 files changed, 12 insertions, 5 deletions
diff --git a/src/n-dhcp4/src/n-dhcp4-c-connection.c b/src/n-dhcp4/src/n-dhcp4-c-connection.c
index 7024b71a..e76ea165 100644
--- a/src/n-dhcp4/src/n-dhcp4-c-connection.c
+++ b/src/n-dhcp4/src/n-dhcp4-c-connection.c
@@ -1010,9 +1010,9 @@ static const char *message_type_to_str(uint8_t type) {
         }
 }
 
-static int n_dhcp4_c_connection_send_request(NDhcp4CConnection *connection,
-                                             NDhcp4Outgoing *request,
-                                             uint64_t timestamp) {
+int n_dhcp4_c_connection_send_request(NDhcp4CConnection *connection,
+                                      NDhcp4Outgoing *request,
+                                      uint64_t timestamp) {
         char server_addr[INET_ADDRSTRLEN];
         char client_addr[INET_ADDRSTRLEN];
         char error_msg[128];
diff --git a/src/n-dhcp4/src/n-dhcp4-c-probe.c b/src/n-dhcp4/src/n-dhcp4-c-probe.c
index ee3a8886..7a6def34 100644
--- a/src/n-dhcp4/src/n-dhcp4-c-probe.c
+++ b/src/n-dhcp4/src/n-dhcp4-c-probe.c
@@ -1137,7 +1137,7 @@ int n_dhcp4_client_probe_transition_decline(NDhcp4ClientProbe *probe, NDhcp4Inco
                 if (r)
                         return r;
 
-                r = n_dhcp4_c_connection_start_request(&probe->connection, request, ns_now);
+                r = n_dhcp4_c_connection_send_request(&probe->connection, request, ns_now);
                 if (r)
                         return r;
                 else
@@ -1332,11 +1332,15 @@ 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;
 
-        r = n_dhcp4_c_connection_start_request(&probe->connection, request_out, 0);
+        r = n_dhcp4_c_connection_send_request(&probe->connection, request_out, 0);
         if (r)
                 return r;
 
diff --git a/src/n-dhcp4/src/n-dhcp4-private.h b/src/n-dhcp4/src/n-dhcp4-private.h
index 40404001..dbfe9b4a 100644
--- a/src/n-dhcp4/src/n-dhcp4-private.h
+++ b/src/n-dhcp4/src/n-dhcp4-private.h
@@ -642,6 +642,9 @@ int n_dhcp4_c_connection_release_new(NDhcp4CConnection *connection,
 int n_dhcp4_c_connection_start_request(NDhcp4CConnection *connection,
                                        NDhcp4Outgoing *request,
                                        uint64_t timestamp);
+int n_dhcp4_c_connection_send_request(NDhcp4CConnection *connection,
+                                      NDhcp4Outgoing *request,
+                                      uint64_t timestamp);
 int n_dhcp4_c_connection_dispatch_timer(NDhcp4CConnection *connection,
                                         uint64_t timestamp);
 int n_dhcp4_c_connection_dispatch_io(NDhcp4CConnection *connection,