From 3a63fc5470caffda434064a439ffdbe8518963f9 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Mon, 7 Jan 2019 09:15:47 -0500 Subject: 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 --- src/vnet/ip/icmp6.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/vnet/ip/icmp6.h') diff --git a/src/vnet/ip/icmp6.h b/src/vnet/ip/icmp6.h index 1cac8240466..628d225eac4 100644 --- a/src/vnet/ip/icmp6.h +++ b/src/vnet/ip/icmp6.h @@ -46,7 +46,8 @@ _ (PACKET_TOO_BIG_SENT, "packet too big response sent") \ _ (TTL_EXPIRE_SENT, "hop limit exceeded response sent") \ _ (PARAM_PROBLEM_SENT, "parameter problem response sent") \ - _ (DROP, "error message dropped") + _ (DROP, "error message dropped") \ + _ (ALLOC_FAILURE, "buffer allocation failure") typedef enum -- cgit 1.2.3-korg