Skip to contentSkip to conversation

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

PATCH Applied John Mark 3 participants 3 messages Mar 22, 2024 – Sep 2, 2024

lore
Share & tools
lore

John Mark

author
#0 lore raw

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

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(+)
gdhcp/client.c +1 -0
index 82017692..c58c7be9 100644
@@ -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) {
Signature · 4 lines
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. 
#1 lore raw
This patch was applied to connman.git (master) by Denis Kenzior <[email protected]>:

Hello:

This patch was applied to connman.git (master)
by Denis Kenzior <[email protected]>:

Quoted 8 lines · On Fri, 22 Mar 2024 09:24:55 -0400 you wrote:

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(+)

Here is the summary with links:
- set pkt_len when packet is received using L3 listening mode so that the ACK can be processed correctly

    https://git.kernel.org/pub/scm/network/connman/connman.git/?id=49b16df36de0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
In reply to John Mark

Hi John,

Quoted 14 lines

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(+)
gdhcp/client.c +0 -0
index 82017692..c58c7be9 100644

gdhcp/client.c static gboolean listener_event(GIOChannel *channel, GIOCondition condition, · line 2322

Quoted 7 lines
gdhcp/client.c +1 -0
@@ -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) {

is this still needed? The patch does no longer apply.

Regards

Marcel