Skip to content

Commit cffb79a

Browse files
simple2017Anas Nashif
authored andcommitted
net: context: set tcp app data len when sending packets
When we send TCP data segment, we need to set the length of the application data by calling net_pkt_set_appdatalen(). This is done so that sequence number can be properly advanced when we receive ACK to that pending packet. Signed-off-by: xiaorui hu <[email protected]>
1 parent 79ea868 commit cffb79a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/ip/net_context.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,7 @@ static int sendto(struct net_pkt *pkt,
17301730

17311731
#if defined(CONFIG_NET_TCP)
17321732
if (net_context_get_ip_proto(context) == IPPROTO_TCP) {
1733+
net_pkt_set_appdatalen(pkt, net_pkt_get_len(pkt));
17331734
ret = net_tcp_queue_data(context, pkt);
17341735
} else
17351736
#endif /* CONFIG_NET_TCP */

0 commit comments

Comments
 (0)