Handle buffer alloc failure in vlib_buffer_add_data 10/16710/2
authorDave Barach <dave@barachs.net>
Mon, 7 Jan 2019 14:15:47 +0000 (09:15 -0500)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 7 Jan 2019 16:47:09 +0000 (16:47 +0000)
commit3a63fc5470caffda434064a439ffdbe8518963f9
tree5413c1a884269a7c93c1ed468608222a2dbd9590
parent9d7570ccde4ded1c5feea097b10272870bfc81da
Handle buffer alloc failure in vlib_buffer_add_data

It's not OK to crash due to a transient buffer allocation failure.

Return 1 if the requested operation failed, otherwise 0.

Buffer index parameter change to a value-result, so the caller can
differentiate between partial and complete allocation failure: callers
which request an initial allocation (inbound bi = ~0) need to check
the (out) value to decide whether or not to call vlib_buffer_free(...).

Change-Id: I03029d7f2714c17dca4630dfd95a1eb578b68384
Signed-off-by: Dave Barach <dave@barachs.net>
src/vlib/buffer.c
src/vlib/buffer_funcs.h
src/vnet/ip/icmp6.h
src/vnet/ip/ip6_neighbor.c
src/vnet/srp/node.c