aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-05-31 08:41:34 -0400
committerDave Barach <dave@barachs.net>2019-05-31 08:42:20 -0400
commitb19bf8de1577612d26ead0a0c6ffb5ee2227172f (patch)
tree88dc0949f2ef7ca8323ff46d09a286c282087d72
parent6a3064fdf6883fa09b4325e6f011f0e8acad295e (diff)
VPP-1692: move NULL pointer check
TBH, this looks like merge damage or some such. Perfectly fine NULL pointer check, about three lines after it was needed. Change-Id: I52831062e30533a59fb76b644ee5ae389676d2ae Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--src/vnet/ip/ip4_forward.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index f3819e34b5e..d8eed67a381 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1820,11 +1820,6 @@ ip4_arp_inline (vlib_main_t * vm,
vlib_packet_template_get_packet (vm,
&im->ip4_arp_request_packet_template,
&bi0);
- b0 = vlib_get_buffer (vm, bi0);
-
- /* copy the persistent fields from the original */
- clib_memcpy_fast (b0->opaque2, p0->opaque2, sizeof (p0->opaque2));
-
/* Seems we're out of buffers */
if (PREDICT_FALSE (!h0))
{
@@ -1832,6 +1827,11 @@ ip4_arp_inline (vlib_main_t * vm,
continue;
}
+ b0 = vlib_get_buffer (vm, bi0);
+
+ /* copy the persistent fields from the original */
+ clib_memcpy_fast (b0->opaque2, p0->opaque2, sizeof (p0->opaque2));
+
/* Add rewrite/encap string for ARP packet. */
vnet_rewrite_one_header (adj0[0], h0, sizeof (ethernet_header_t));