aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorZhiyong Yang <zhiyong.yang@intel.com>2020-04-11 14:36:55 +0000
committerDamjan Marion <dmarion@me.com>2020-04-22 13:04:17 +0000
commit9f83358d4eec9dbd5f74b0ff65d1c0d309bd5dda (patch)
tree177e6f8e6fd10710b37709291059019b06d33c80 /src/vnet
parent332bc084dd15a2c7b7b26bb00775c835c9630e8a (diff)
ethernet: leverage vlib_buffer_get_current
Type: improvement Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Change-Id: I0eaedeee03dd3b4453edec7fca2a5c741a98de23
Diffstat (limited to 'src/vnet')
-rwxr-xr-xsrc/vnet/ethernet/node.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index cc27b6f5da9..5136da4e525 100755
--- a/src/vnet/ethernet/node.c
+++ b/src/vnet/ethernet/node.c
@@ -114,7 +114,7 @@ parse_header (ethernet_input_variant_t variant,
{
ethernet_header_t *e0;
- e0 = (void *) (b0->data + b0->current_data);
+ e0 = vlib_buffer_get_current (b0);
vnet_buffer (b0)->l2_hdr_offset = b0->current_data;
b0->flags |= VNET_BUFFER_F_L2_HDR_OFFSET_VALID;
@@ -128,7 +128,7 @@ parse_header (ethernet_input_variant_t variant,
// here when prior node was LLC/SNAP processing
u16 *e0;
- e0 = (void *) (b0->data + b0->current_data);
+ e0 = vlib_buffer_get_current (b0);
vlib_buffer_advance (b0, sizeof (e0[0]));
@@ -153,7 +153,7 @@ parse_header (ethernet_input_variant_t variant,
*match_flags = SUBINT_CONFIG_VALID | SUBINT_CONFIG_MATCH_1_TAG;
- h0 = (void *) (b0->data + b0->current_data);
+ h0 = vlib_buffer_get_current (b0);
tag = clib_net_to_host_u16 (h0->priority_cfi_and_id);
@@ -171,7 +171,7 @@ parse_header (ethernet_input_variant_t variant,
// Double tagged packet
*match_flags = SUBINT_CONFIG_VALID | SUBINT_CONFIG_MATCH_2_TAG;
- h0 = (void *) (b0->data + b0->current_data);
+ h0 = vlib_buffer_get_current (b0);
tag = clib_net_to_host_u16 (h0->priority_cfi_and_id);