aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-01-09 00:04:04 -0800
committerNeale Ranns <nranns@cisco.com>2019-01-10 13:29:33 +0000
commit45db885a6a050aa809ae333bf6c14349db644822 (patch)
treee58cbf714460230cc842185992d4a2720ccca83b /src/vnet/ip
parente33cab390705f7fd24cf9443a18a96a4e309707d (diff)
ARP/ND: copy opaque2 persistent fields to new packet
Change-Id: Ic65f686aaccaf8450732d88d7471b587faccaa9d Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip4_forward.c5
-rwxr-xr-xsrc/vnet/ip/ip6_neighbor.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index f523ae63ba3..1a1b7e5182b 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1854,6 +1854,10 @@ 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))
@@ -1894,7 +1898,6 @@ ip4_arp_inline (vlib_main_t * vm,
p0->error = node->errors[IP4_ARP_ERROR_REQUEST_SENT];
vlib_buffer_copy_trace_flag (vm, p0, bi0);
- b0 = vlib_get_buffer (vm, bi0);
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
vnet_buffer (b0)->sw_if_index[VLIB_TX] = sw_if_index0;
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index fde3a7e71d4..3acfb1a4897 100755
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -3284,6 +3284,10 @@ ip6_discover_neighbor_inline (vlib_main_t * vm,
if (!h0)
continue;
+ /* copy the persistent fields from the original */
+ b0 = vlib_get_buffer (vm, bi0);
+ clib_memcpy_fast (b0->opaque2, p0->opaque2, sizeof (p0->opaque2));
+
/*
* Build ethernet header.
* Choose source address based on destination lookup
@@ -3324,7 +3328,6 @@ ip6_discover_neighbor_inline (vlib_main_t * vm,
ASSERT (bogus_length == 0);
vlib_buffer_copy_trace_flag (vm, p0, bi0);
- b0 = vlib_get_buffer (vm, bi0);
vnet_buffer (b0)->sw_if_index[VLIB_TX]
= vnet_buffer (p0)->sw_if_index[VLIB_TX];