From: Pierre Pfister Date: Thu, 30 Jun 2016 13:06:55 +0000 (+0100) Subject: Fix buffer leak from L2 flooding replication process X-Git-Tag: v16.09-rc1~222 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=371fa4411048c4f34a3f35dc0398e1b01c6928cd;p=vpp.git 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 --- 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);