[PATCH] set pkt_len when packet is received using L3 listening mode so that the ACK can be processed correctly

John Mark <[email protected]>
Newsgroups dev.linux.lists.connman
Message-ID <[email protected]>
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.

---
 gdhcp/client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index 82017692..c58c7be9 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) {
-- 
2.34.1


Confidentiality Notice: This e-mail is privileged and confidential and for the use of the addressee only. Should you have received this e-mail in error please notify us by replying directly to the sender or by sending a message to [email protected]. Unauthorised dissemination, disclosure or copying of the contents of this e-mail, or any similar action, is prohibited.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.