mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-16 14:11:02 +00:00
Fix unit test with assumed congestion avoidance
test_tcp_fast_rexmit_wraparound correctness relied on the congestion window being in congestion avoidance so that only a single TCP_MSS segment is sent upon ACKing the first segment. It's not known whether the test was relying tcp_alloc() to set ssthresh to 0 and thus start in congestion avoidance or if the test was working by accident until changes inb90a54f989
This fixes the test by enforcing the requirement of starting in congestion avoidance Signed-off-by: goldsimon <goldsimon@gmx.de> (cherry picked from commit8bf402fd67
)
This commit is contained in:
parent
0381849624
commit
c31bd404e2
@ -422,6 +422,8 @@ START_TEST(test_tcp_fast_rexmit_wraparound)
|
|||||||
pcb->mss = TCP_MSS;
|
pcb->mss = TCP_MSS;
|
||||||
/* disable initial congestion window (we don't send a SYN here...) */
|
/* disable initial congestion window (we don't send a SYN here...) */
|
||||||
pcb->cwnd = 2*TCP_MSS;
|
pcb->cwnd = 2*TCP_MSS;
|
||||||
|
/* start in congestion advoidance */
|
||||||
|
pcb->ssthresh = pcb->cwnd;
|
||||||
|
|
||||||
/* send 6 mss-sized segments */
|
/* send 6 mss-sized segments */
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
@ -442,7 +444,9 @@ START_TEST(test_tcp_fast_rexmit_wraparound)
|
|||||||
/* ACK the first segment */
|
/* ACK the first segment */
|
||||||
p = tcp_create_rx_segment(pcb, NULL, 0, 0, TCP_MSS, TCP_ACK);
|
p = tcp_create_rx_segment(pcb, NULL, 0, 0, TCP_MSS, TCP_ACK);
|
||||||
test_tcp_input(p, &netif);
|
test_tcp_input(p, &netif);
|
||||||
/* ensure this didn't trigger a retransmission */
|
/* ensure this didn't trigger a retransmission. Only one
|
||||||
|
segment should be transmitted because cwnd opened up by
|
||||||
|
TCP_MSS and a fraction since we are in congestion avoidance */
|
||||||
EXPECT(txcounters.num_tx_calls == 1);
|
EXPECT(txcounters.num_tx_calls == 1);
|
||||||
EXPECT(txcounters.num_tx_bytes == TCP_MSS + 40U);
|
EXPECT(txcounters.num_tx_bytes == TCP_MSS + 40U);
|
||||||
memset(&txcounters, 0, sizeof(txcounters));
|
memset(&txcounters, 0, sizeof(txcounters));
|
||||||
|
Loading…
Reference in New Issue
Block a user