summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2016-06-30 14:06:55 +0100
committerDave Barach <openvpp@barachs.net>2016-06-30 14:15:52 +0000
commit371fa4411048c4f34a3f35dc0398e1b01c6928cd (patch)
tree6ec5d82648fac27e2101cd39396ee3e92a0469af
parentc4770ecc622e815bd6f355aea0bedfe38820c757 (diff)
Fix buffer leak from L2 flooding replication process
vlib_buffer_free_inline actually checks (b->flags & VLIB_BUFFER_RECYCLE) in order to decide whether to free the packet or not. Although the flag was correctly set in replication_prep, it is not removed by replication_recycle during last iteration. This patch just removes VLIB_BUFFER_RECYCLE when is_last is set. Change-Id: I2445ebce908d94d95535e706b40407b4f15906e4 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
-rw-r--r--vnet/vnet/replication.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vnet/vnet/replication.c b/vnet/vnet/replication.c
index 999e1b12326..fc2cbd1d860 100644
--- a/vnet/vnet/replication.c
+++ b/vnet/vnet/replication.c
@@ -122,6 +122,7 @@ replication_recycle (vlib_main_t * vm,
// This is the last replication in the list.
// Restore original buffer free functionality.
b0->free_list_index = ctx->saved_free_list_index;
+ b0->flags &= ~VLIB_BUFFER_RECYCLE;
// Free context back to its pool
pool_put (rm->contexts[cpu_number], ctx);