From 17479d5347a2afb0def9a71a01534057de8ec43b Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Tue, 5 Mar 2024 11:54:50 +0100 Subject: [PATCH] n-dhcp4: set xid value of the DHCP header for RELEASE and DECLINE message The `xid` of the DHCP header must be initialized for RELEASE and DECLINE messages [1]. [1] https://datatracker.ietf.org/doc/html/rfc2131#section-4.4.1 (cherry picked from commit 0f0f1bbf8aa5c8d47252e6b8349186948f7529f5) --- src/n-dhcp4/src/n-dhcp4-c-connection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/n-dhcp4/src/n-dhcp4-c-connection.c b/src/n-dhcp4/src/n-dhcp4-c-connection.c index 7cb4f23fe0..7024b71ac9 100644 --- a/src/n-dhcp4/src/n-dhcp4-c-connection.c +++ b/src/n-dhcp4/src/n-dhcp4-c-connection.c @@ -1031,13 +1031,13 @@ static int n_dhcp4_c_connection_send_request(NDhcp4CConnection *connection, case N_DHCP4_C_MESSAGE_REBOOT: case N_DHCP4_C_MESSAGE_REBIND: case N_DHCP4_C_MESSAGE_RENEW: + case N_DHCP4_C_MESSAGE_DECLINE: + case N_DHCP4_C_MESSAGE_RELEASE: request->userdata.base_time = timestamp; n_dhcp4_outgoing_set_xid(request, n_dhcp4_client_probe_config_get_random(connection->probe_config)); break; case N_DHCP4_C_MESSAGE_SELECT: - case N_DHCP4_C_MESSAGE_DECLINE: - case N_DHCP4_C_MESSAGE_RELEASE: break; default: c_assert(0);