|
From: | Ambroz Bizjak |
Subject: | [lwip-devel] [bug #48543] TCP sent callback may prematurely report sent data when only part of a segment is acked |
Date: | Tue, 19 Jul 2016 17:54:45 +0000 (UTC) |
User-agent: | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 |
Follow-up Comment #3, bug #48543 (project lwip): Here, I've implemented a fix in my fork: https://github.com/ambrop72/aprinter/commit/a4f6315b4822a25a01a652ff8e162a1839b29d67 I calculate tcp_acked by summing the lengths of the segments that have been freed due to the ACK. So the stack will not report data as acked until the entire segment has been acked. Note if applying this to lwIP some care is needed due to various weirdness that I have already resolved in my fork: - lwIP's pcb->snd_buf includes one count for SYN/FIN; in my patch I sum up the seg->len (no flag counts) and add it to pcb->snd_buf (also no flag counts due to refactoring). - Acked segments can be in ->unacked or ->unsent; for some reason the freeing of ->unsent segments is lower in the code outside of "else if" where the main ack handling code is. I think it can be moved up and consolidated. _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?48543> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |