aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_forward.c
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-06-19 15:27:48 -0400
committerDave Barach <openvpp@barachs.net>2018-06-19 21:26:10 +0000
commit084606befb45507e9241b5555f86196fe08530f6 (patch)
tree25982dd871832335b2f62159657c3b3b31e361f2 /src/vnet/ip/ip4_forward.c
parent7e607a73898b81c21a24038a2350fdda3b1c67ff (diff)
Check get packet template allocation failure (VPP-1321)
After calling vlib_packet_template_get_packet(), make sure packet buffer is allocated before using it. Change-Id: Idb5199f4e2c9596137b2101e502d611f474a6ffe Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_forward.c')
-rw-r--r--src/vnet/ip/ip4_forward.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index 0035cc8a552..677f88cf90c 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1960,6 +1960,9 @@ ip4_probe_neighbor (vlib_main_t * vm, ip4_address_t * dst, u32 sw_if_index,
&im->ip4_arp_request_packet_template,
&bi);
+ if (!h)
+ return clib_error_return (0, "ARP request packet allocation failed");
+
hi = vnet_get_sup_hw_interface (vnm, sw_if_index);
if (PREDICT_FALSE (!hi->hw_address))
{