net: tcp: Use appdatalen when acknowledging packets

If the length of all fragments is used instead, the TCP header is also
considered; sequence numbers do not consider the header.

Change-Id: I19e77ac0fe62ca619b0903dd0265f8ea4878cdf7
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
Leandro Pereira 2016-12-21 12:11:51 -08:00 committed by Tomasz Bursztyka
commit fb02efb1c9

View file

@ -683,8 +683,7 @@ void net_tcp_ack_received(struct net_context *ctx, uint32_t ack)
buf = CONTAINER_OF(head, struct net_buf, sent_list); buf = CONTAINER_OF(head, struct net_buf, sent_list);
tcphdr = NET_TCP_BUF(buf); tcphdr = NET_TCP_BUF(buf);
seq = sys_get_be32(tcphdr->seq) seq = sys_get_be32(tcphdr->seq) + net_nbuf_appdatalen(buf) - 1;
+ net_buf_frags_len(buf) - 1;
if (seq_greater(ack, seq)) { if (seq_greater(ack, seq)) {
sys_slist_remove(list, NULL, head); sys_slist_remove(list, NULL, head);