diff options
author | 2020-04-08 08:14:57 -0400 | |
---|---|---|
committer | 2020-04-13 14:57:22 +0000 | |
commit | d55f62f78888315c6caa58c9c7638c8109bb37cd (patch) | |
tree | 619b0cb725091ab6da8370e7063c5596a549d3b7 /src/plugins/dhcp/dhcp6_ia_na_client_dp.c | |
parent | 8c6efc06104ebccf4915d0d10c399292bac55874 (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
(cherry picked from commit 954c707972bf7efcd227e26d9679544813a78115)
Diffstat (limited to 'src/plugins/dhcp/dhcp6_ia_na_client_dp.c')
-rw-r--r-- | src/plugins/dhcp/dhcp6_ia_na_client_dp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/dhcp/dhcp6_ia_na_client_dp.c b/src/plugins/dhcp/dhcp6_ia_na_client_dp.c index 3cf2fb1b349..c240beb3eb3 100644 --- a/src/plugins/dhcp/dhcp6_ia_na_client_dp.c +++ b/src/plugins/dhcp/dhcp6_ia_na_client_dp.c @@ -258,6 +258,9 @@ check_send_client_message (vlib_main_t * vm, next_index = ip6_rewrite_mcast_node.index; c0 = vlib_buffer_copy (vm, p0); + if (c0 == NULL) + return client_state->keep_sending_client_message; + ci0 = vlib_get_buffer_index (vm, c0); ip = (ip6_header_t *) vlib_buffer_get_current (c0); |