summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip6-nd/ip6_ra.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-04-08 08:14:57 -0400
committerFlorin Coras <florin.coras@gmail.com>2020-04-08 16:29:44 +0000
commit954c707972bf7efcd227e26d9679544813a78115 (patch)
tree99e3ff617ceaef9c94f5cb33176ac14d248a316b /src/vnet/ip6-nd/ip6_ra.c
parent8d0d8d2fcccd77e462f30b21f7f8810db312ee62 (diff)
misc: check return values from vlib_buffer_copy(...)
vlib_buffer_copy(...) returns NULL if the system is temporarily out of buffers. This is NOT correct. Please don't be this person: c0 = vlib_buffer_copy (vm, p0); ci0 = vlib_get_buffer_index (vm, c0); Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ic25ef58965871ea5d2b40904df9506803f69e47e
Diffstat (limited to 'src/vnet/ip6-nd/ip6_ra.c')
-rw-r--r--src/vnet/ip6-nd/ip6_ra.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/ip6-nd/ip6_ra.c b/src/vnet/ip6-nd/ip6_ra.c
index 769f9dabe5c..af82a06eb2b 100644
--- a/src/vnet/ip6-nd/ip6_ra.c
+++ b/src/vnet/ip6-nd/ip6_ra.c
@@ -1219,6 +1219,9 @@ check_send_rs (vlib_main_t * vm, ip6_ra_t * radv_info, f64 current_time,
next_index = ip6_rewrite_mcast_node.index;
c0 = vlib_buffer_copy (vm, p0);
+ if (c0 == NULL)
+ return radv_info->keep_sending_rs;
+
ci0 = vlib_get_buffer_index (vm, c0);
f = vlib_get_frame_to_node (vm, next_index);