summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/unittest/tcp_test.c13
-rw-r--r--src/vnet/tcp/tcp_bt.c1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/unittest/tcp_test.c b/src/plugins/unittest/tcp_test.c
index 940ffcf94c4..7aa24562d7e 100644
--- a/src/plugins/unittest/tcp_test.c
+++ b/src/plugins/unittest/tcp_test.c
@@ -1094,6 +1094,19 @@ tcp_test_delivery (vlib_main_t * vm, unformat_input_t * input)
TCP_TEST (tc->app_limited == 0, "app limited should be cleared");
/*
+ * 9) test flush
+ */
+
+ tcp_bt_track_tx (tc);
+ tc->snd_nxt += burst;
+
+ session_main.wrk[thread_index].last_vlib_time = 12;
+ tcp_bt_track_tx (tc);
+ tc->snd_nxt += burst;
+
+ tcp_bt_flush_samples (tc);
+
+ /*
* Cleanup
*/
vec_free (sacks);
diff --git a/src/vnet/tcp/tcp_bt.c b/src/vnet/tcp/tcp_bt.c
index dd3d9539d9a..fe007543cd0 100644
--- a/src/vnet/tcp/tcp_bt.c
+++ b/src/vnet/tcp/tcp_bt.c
@@ -544,6 +544,7 @@ tcp_bt_flush_samples (tcp_connection_t * tc)
u32 *samples = 0, *si;
vec_validate (samples, pool_elts (bt->samples) - 1);
+ vec_reset_length (samples);
/* *INDENT-OFF* */
pool_foreach (bts, bt->samples, ({