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 <xiaorui.hu@linaro.org>
This commit is contained in:
parent
79ea8685a5
commit
cffb79a4e1
1 changed files with 1 additions and 0 deletions
|
@ -1730,6 +1730,7 @@ static int sendto(struct net_pkt *pkt,
|
|||
|
||||
#if defined(CONFIG_NET_TCP)
|
||||
if (net_context_get_ip_proto(context) == IPPROTO_TCP) {
|
||||
net_pkt_set_appdatalen(pkt, net_pkt_get_len(pkt));
|
||||
ret = net_tcp_queue_data(context, pkt);
|
||||
} else
|
||||
#endif /* CONFIG_NET_TCP */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue