diff options
author | Steven <sluong@cisco.com> | 2017-09-28 16:38:56 -0700 |
---|---|---|
committer | steven luong <sluong@cisco.com> | 2017-09-29 18:23:54 +0000 |
commit | 1808f3c00a7bcdea7f0c004ef0613db2156c2065 (patch) | |
tree | 8a61a78665a1153ad78eabecdd8191f93f547ec7 /src/vnet/lldp/lldp_output.c | |
parent | 3fd57e67532bd55701bef7365adc17da229a44dc (diff) |
cdp/lldp: punt for no buffer (VPP-997)
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>
(cherry picked from commit 0ff5c563d5048991dbd02a3892dccde8305a7e30)
Diffstat (limited to 'src/vnet/lldp/lldp_output.c')
-rw-r--r-- | src/vnet/lldp/lldp_output.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/lldp/lldp_output.c b/src/vnet/lldp/lldp_output.c index 950b79aebc6..8698ec976ac 100644 --- a/src/vnet/lldp/lldp_output.c +++ b/src/vnet/lldp/lldp_output.c @@ -145,6 +145,9 @@ lldp_send_ethernet (lldp_main_t * lm, lldp_intf_t * n, int shutdown) */ h0 = vlib_packet_template_get_packet (vm, &lm->packet_template, &bi0); + if (!h0) + return; + /* Add the interface's ethernet source address */ hw = vnet_get_hw_interface (vnm, n->hw_if_index); |