diff options
Diffstat (limited to 'src/vnet/ip')
-rw-r--r-- | src/vnet/ip/ip4_forward.c | 3 | ||||
-rw-r--r-- | src/vnet/ip/ip6_forward.c | 2 | ||||
-rw-r--r-- | src/vnet/ip/ip6_neighbor.c | 7 |
3 files changed, 12 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)) { diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c index 5ea7d8d6e9d..cf1011fa897 100644 --- a/src/vnet/ip/ip6_forward.c +++ b/src/vnet/ip/ip6_forward.c @@ -1476,6 +1476,8 @@ ip6_probe_neighbor (vlib_main_t * vm, ip6_address_t * dst, u32 sw_if_index, vlib_packet_template_get_packet (vm, &im->discover_neighbor_packet_template, &bi); + if (!h) + return clib_error_return (0, "ICMP6 NS packet allocation failed"); hi = vnet_get_sup_hw_interface (vnm, sw_if_index); diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c index e281d7e1d2f..6d91224c0b4 100644 --- a/src/vnet/ip/ip6_neighbor.c +++ b/src/vnet/ip/ip6_neighbor.c @@ -466,6 +466,8 @@ ip6_nbr_probe (ip_adjacency_t * adj) h = vlib_packet_template_get_packet (vm, &im->discover_neighbor_packet_template, &bi); + if (!h) + return; hi = vnet_get_sup_hw_interface (vnm, adj->rewrite_header.sw_if_index); @@ -3285,6 +3287,8 @@ ip6_discover_neighbor_inline (vlib_main_t * vm, h0 = vlib_packet_template_get_packet (vm, &im->discover_neighbor_packet_template, &bi0); + if (!h0) + continue; /* * Build ethernet header. @@ -5037,6 +5041,9 @@ send_ip6_na_w_addr (vlib_main_t * vm, vlib_packet_template_get_packet (vm, &i6m->discover_neighbor_packet_template, &bi); + if (!h) + return; + ip6_set_reserved_multicast_address (&h->ip.dst_address, IP6_MULTICAST_SCOPE_link_local, IP6_MULTICAST_GROUP_ID_all_hosts); |