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 0f0f1bbf8a)
This commit is contained in:
Fernando Fernandez Mancera 2024-03-05 11:54:50 +01:00 committed by Wen Liang
parent f906604e2e
commit 17479d5347

View file

@ -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);