summaryrefslogtreecommitdiffstats
path: root/src/vnet/cdp/cdp_periodic.c
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-09-28 16:38:56 -0700
committerSteven <sluong@cisco.com>2017-09-28 16:38:56 -0700
commit0ff5c563d5048991dbd02a3892dccde8305a7e30 (patch)
treed7a86fe93f5aed2990d6684028362d44ff73ae8a /src/vnet/cdp/cdp_periodic.c
parent905e250baf982aa5b81265d8f88ec022ef8666ce (diff)
cdp/lldp: punt for no buffer
When making a call to vlib_packet_template_get_packet(), it is possible to get back a NULL if the system runs out of buffer. This can happen when there is buffer leaks. But don't crash just because we run out of buffers, just punt. Change-Id: Ie90ea41f3dda6e583d48959cbd18ff124158d7f8 Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/vnet/cdp/cdp_periodic.c')
-rw-r--r--src/vnet/cdp/cdp_periodic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/cdp/cdp_periodic.c b/src/vnet/cdp/cdp_periodic.c
index de111079aa3..8899c49ce9c 100644
--- a/src/vnet/cdp/cdp_periodic.c
+++ b/src/vnet/cdp/cdp_periodic.c
@@ -125,6 +125,9 @@ send_ethernet_hello (cdp_main_t * cm, cdp_neighbor_t * n, int count)
h0 = vlib_packet_template_get_packet
(vm, &cm->packet_templates[n->packet_template_index], &bi0);
+ if (!h0)
+ break;
+
/* Add the interface's ethernet source address */
hw = vnet_get_sup_hw_interface (vnm, n->sw_if_index);