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:
xiaorui hu 2017-05-04 00:37:23 +08:00 committed by Anas Nashif
commit cffb79a4e1

View file

@ -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 */