summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/vnet/ethernet/node.c5
-rw-r--r--src/vnet/l2/l2_input_vtr.c15
-rw-r--r--src/vnet/l2/l2_vtr.c3
3 files changed, 7 insertions, 16 deletions
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index 8967cebefee..4529ca6a572 100755
--- a/src/vnet/ethernet/node.c
+++ b/src/vnet/ethernet/node.c
@@ -165,11 +165,12 @@ parse_header (ethernet_input_variant_t variant,
vlib_buffer_advance (b0, sizeof (h0[0]));
vlan_count = 2;
-
if (*type == ETHERNET_TYPE_VLAN)
{
// More than double tagged packet
*match_flags = SUBINT_CONFIG_VALID | SUBINT_CONFIG_MATCH_3_TAG;
+
+ vlib_buffer_advance (b0, sizeof (h0[0]));
vlan_count = 3; // "unknown" number, aka, 3-or-more
}
}
@@ -239,6 +240,8 @@ determine_next_node (ethernet_main_t * em,
// record the L2 len and reset the buffer so the L2 header is preserved
u32 eth_start = vnet_buffer (b0)->ethernet.start_of_ethernet_header;
vnet_buffer (b0)->l2.l2_len = b0->current_data - eth_start;
+ ASSERT (vnet_buffer (b0)->l2.l2_len ==
+ ethernet_buffer_header_size (b0));
vlib_buffer_advance (b0, -ethernet_buffer_header_size (b0));
// check for common IP/MPLS ethertypes
diff --git a/src/vnet/l2/l2_input_vtr.c b/src/vnet/l2/l2_input_vtr.c
index 60a39631e87..ded23095849 100644
--- a/src/vnet/l2/l2_input_vtr.c
+++ b/src/vnet/l2/l2_input_vtr.c
@@ -188,10 +188,7 @@ l2_invtr_node_fn (vlib_main_t * vm,
if (config0->output_vtr.push_and_pop_bytes)
{
/* perform the tag rewrite on two packets */
- if (l2_vtr_process
- (b0,
- &(vec_elt_at_index
- (l2output_main.configs, sw_if_index0)->input_vtr)))
+ if (l2_vtr_process (b0, &config0->input_vtr))
{
/* Drop packet */
next0 = L2_INVTR_NEXT_DROP;
@@ -212,10 +209,7 @@ l2_invtr_node_fn (vlib_main_t * vm,
{
if (config1->output_vtr.push_and_pop_bytes)
{
- if (l2_vtr_process
- (b1,
- &(vec_elt_at_index
- (l2output_main.configs, sw_if_index1)->input_vtr)))
+ if (l2_vtr_process (b1, &config1->input_vtr))
{
/* Drop packet */
next1 = L2_INVTR_NEXT_DROP;
@@ -305,10 +299,7 @@ l2_invtr_node_fn (vlib_main_t * vm,
if (config0->output_vtr.push_and_pop_bytes)
{
/* perform the tag rewrite on one packet */
- if (l2_vtr_process
- (b0,
- &(vec_elt_at_index
- (l2output_main.configs, sw_if_index0)->input_vtr)))
+ if (l2_vtr_process (b0, &config0->input_vtr))
{
/* Drop packet */
next0 = L2_INVTR_NEXT_DROP;
diff --git a/src/vnet/l2/l2_vtr.c b/src/vnet/l2/l2_vtr.c
index 3c5365f9b51..02a68991376 100644
--- a/src/vnet/l2/l2_vtr.c
+++ b/src/vnet/l2/l2_vtr.c
@@ -229,9 +229,6 @@ l2vtr_configure (vlib_main_t * vlib_main, vnet_main_t * vnet_main, u32 sw_if_ind
}
in_config->pop_bytes = 8;
in_config->push_bytes = 0;
-
- out_config->push_bytes = in_config->pop_bytes;
- out_config->pop_bytes = in_config->push_bytes;
break;
case L2_VTR_PUSH_1: