Fix a long-latent bi=0 bug in vlib_buffer_add_data
Change vlib_buffer_add_data() so it interprets ~0 to mean please
allocate a new buffer, instead of 0. Fixed a couple of calls to pass
~0 instead of 0.
Zero has always been a valid buffer index, we never happened to
actually use it until recent buffer allocator changes.
The presenting symptom: ASSERT failure when running "make
TEST=test_mpls test-debug"
Change-Id: Ic909913c1d464b3434d6d47e0c58f978806854d5
Signed-off-by: Dave Barach <dave@barachs.net>
diff --git a/src/vnet/srp/node.c b/src/vnet/srp/node.c
index 9123c4c..acb770e 100644
--- a/src/vnet/srp/node.c
+++ b/src/vnet/srp/node.c
@@ -334,7 +334,7 @@
u32 bi;
bi = vlib_buffer_add_data (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX,
- /* buffer to append to */ 0,
+ /* buffer to append to */ ~0,
*contents, vec_len (*contents));
b = vlib_get_buffer (vm, bi);
vnet_buffer (b)->sw_if_index[VLIB_RX] = vnet_buffer (b)->sw_if_index[VLIB_TX] = sw_if_index;
@@ -621,7 +621,7 @@
sizeof (i[0]) - STRUCT_OFFSET_OF (srp_ips_header_t, control)));
bi = vlib_buffer_add_data (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX,
- /* buffer to append to */ 0,
+ /* buffer to append to */ ~0,
i, sizeof (i[0]));
/* FIXME trace. */