summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/ip/ip4_forward.c5
-rwxr-xr-xsrc/vnet/ip/ip6_neighbor.c5
-rw-r--r--src/vnet/vxlan-gbp/encap.c10
-rw-r--r--test/test_gbp.py5
4 files changed, 19 insertions, 6 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];
diff --git a/src/vnet/vxlan-gbp/encap.c b/src/vnet/vxlan-gbp/encap.c
index d260ccc0deb..f1b839ce316 100644
--- a/src/vnet/vxlan-gbp/encap.c
+++ b/src/vnet/vxlan-gbp/encap.c
@@ -50,6 +50,7 @@ typedef struct
u32 tunnel_index;
u32 vni;
u16 sclass;
+ u8 flags;
} vxlan_gbp_encap_trace_t;
u8 *
@@ -59,8 +60,10 @@ format_vxlan_gbp_encap_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
vxlan_gbp_encap_trace_t *t = va_arg (*args, vxlan_gbp_encap_trace_t *);
- s = format (s, "VXLAN_GBP encap to vxlan_gbp_tunnel%d vni %d sclass %d",
- t->tunnel_index, t->vni, t->sclass);
+ s =
+ format (s,
+ "VXLAN_GBP encap to vxlan_gbp_tunnel%d vni %d sclass %d flags %d",
+ t->tunnel_index, t->vni, t->sclass, t->flags);
return s;
}
@@ -322,6 +325,7 @@ vxlan_gbp_encap_inline (vlib_main_t * vm,
tr->tunnel_index = t0 - vxm->tunnels;
tr->vni = t0->vni;
tr->sclass = vnet_buffer2 (b0)->gbp.src_epg;
+ tr->flags = vnet_buffer2 (b0)->gbp.flags;
}
if (PREDICT_FALSE (b1->flags & VLIB_BUFFER_IS_TRACED))
@@ -331,6 +335,7 @@ vxlan_gbp_encap_inline (vlib_main_t * vm,
tr->tunnel_index = t1 - vxm->tunnels;
tr->vni = t1->vni;
tr->sclass = vnet_buffer2 (b1)->gbp.src_epg;
+ tr->flags = vnet_buffer2 (b1)->gbp.flags;
}
vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
@@ -465,6 +470,7 @@ vxlan_gbp_encap_inline (vlib_main_t * vm,
tr->tunnel_index = t0 - vxm->tunnels;
tr->vni = t0->vni;
tr->sclass = vnet_buffer2 (b0)->gbp.src_epg;
+ tr->flags = vnet_buffer2 (b0)->gbp.flags;
}
vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
to_next, n_left_to_next,
diff --git a/test/test_gbp.py b/test/test_gbp.py
index 568191c6f35..51df8d9e936 100644
--- a/test/test_gbp.py
+++ b/test/test_gbp.py
@@ -3135,8 +3135,9 @@ class TestGBP(VppTestCase):
self.assertEqual(rx[VXLAN].vni, 88)
self.assertTrue(rx[VXLAN].flags.G)
self.assertTrue(rx[VXLAN].flags.Instance)
- # policy is not applied since we don't know where it's going
- self.assertFalse(rx[VXLAN].gpflags.A)
+ # policy was applied to the original IP packet
+ self.assertEqual(rx[VXLAN].gpid, 200)
+ self.assertTrue(rx[VXLAN].gpflags.A)
self.assertFalse(rx[VXLAN].gpflags.D)
inner = rx[VXLAN].payload