Fix buffer leak from L2 flooding replication process 24/1824/2
authorPierre Pfister <ppfister@cisco.com>
Thu, 30 Jun 2016 13:06:55 +0000 (14:06 +0100)
committerDave Barach <openvpp@barachs.net>
Thu, 30 Jun 2016 14:15:52 +0000 (14:15 +0000)
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>
vnet/vnet/replication.c

index 999e1b1..fc2cbd1 100644 (file)
@@ -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);