diff options
author | John Mark <john.mark@kistler.com> | 2024-03-22 09:24:55 -0400 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-04-03 13:17:18 -0500 |
commit | 49b16df36de0604c55d596119b2350c5c327a517 (patch) | |
tree | 3bd140ce087e66b76675e5d872bf6bbf653ca3f6 | |
parent | 1292984157746dcdc3b2d6b36d28a50ab9c69059 (diff) | |
download | connman-49b16df36de0604c55d596119b2350c5c327a517.tar.gz |
gdhcp: Set pkt_len for packets received in L3 mode
The packet length is not set correctly when an IPv4 L3 ACK is received
from a DHCP server. This causes the packet to be rejected for having
no MESSAGE_TYPE option and the lease is not renewed at the T1 point
(or any subsequent retry). Instead, the lease gets re-bound at the T2
point.
Fixes: 58d397ba7487 ("gdhcp: Avoid reading invalid data in dhcp_get_option")
-rw-r--r-- | gdhcp/client.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c index 820176926..c58c7be91 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -2316,6 +2316,7 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition, } else { re = dhcp_recv_l3_packet(&packet, dhcp_client->listener_sockfd); + pkt_len = (uint16_t)(unsigned int)re; xid = packet.xid; } } else if (dhcp_client->listen_mode == L_ARP) { |