aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2020-04-03 12:14:29 +0000
committerDamjan Marion <dmarion@me.com>2020-04-28 21:09:14 +0000
commitbeee60d2c34f7d72afd8d795416b431929c87071 (patch)
tree048969afa23b17b3025287985117db96368ed8e5
parentca6307ccb97c4476bcc174484d80ada0a9c9bc0c (diff)
ipsec: fix buffer alloc
Type: fix Change-Id: I0f12c19b79df19b692f18ac13d6c32341853b764 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
-rw-r--r--src/vnet/ipsec/esp_decrypt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vnet/ipsec/esp_decrypt.c b/src/vnet/ipsec/esp_decrypt.c
index 80b3246f925..0d14fe56740 100644
--- a/src/vnet/ipsec/esp_decrypt.c
+++ b/src/vnet/ipsec/esp_decrypt.c
@@ -527,7 +527,13 @@ esp_decrypt_inline (vlib_main_t * vm,
{
/* no space, need to allocate new buffer */
u32 tmp_bi = 0;
- vlib_buffer_alloc (vm, &tmp_bi, 1);
+ if (1 != vlib_buffer_alloc (vm, &tmp_bi, 1))
+ {
+ b[0]->error = node->errors
+ [ESP_DECRYPT_ERROR_NO_BUFFERS];
+ next[0] = ESP_DECRYPT_NEXT_DROP;
+ goto next;
+ }
tmp_b = vlib_get_buffer (vm, tmp_bi);
esn = tmp_b->data;
pd->free_buffer_index = tmp_bi;