From d7d24990a0cafc70909106f4fc9b6fb4480c3aa0 Mon Sep 17 00:00:00 2001 From: Zhiyong Yang Date: Tue, 28 May 2019 00:57:39 -0400 Subject: llc_input: simplify code using existing functions Change-Id: I3906adf9aa20b4221eeb7a8b5b353c6f0cb32d04 Signed-off-by: Zhiyong Yang --- src/vnet/llc/node.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/vnet/llc') diff --git a/src/vnet/llc/node.c b/src/vnet/llc/node.c index 60b5c13420c..542a7fd20f8 100644 --- a/src/vnet/llc/node.c +++ b/src/vnet/llc/node.c @@ -128,17 +128,14 @@ llc_input (vlib_main_t * vm, b0 = vlib_get_buffer (vm, bi0); b1 = vlib_get_buffer (vm, bi1); - h0 = (void *) (b0->data + b0->current_data); - h1 = (void *) (b1->data + b1->current_data); + h0 = vlib_buffer_get_current (b0); + h1 = vlib_buffer_get_current (b1); len0 = llc_header_length (h0); len1 = llc_header_length (h1); - b0->current_data += len0; - b1->current_data += len1; - - b0->current_length -= len0; - b1->current_length -= len1; + vlib_buffer_advance (b0, len0); + vlib_buffer_advance (b1, len1); next0 = lm->input_next_by_protocol[h0->dst_sap]; next1 = lm->input_next_by_protocol[h1->dst_sap]; @@ -207,13 +204,11 @@ llc_input (vlib_main_t * vm, b0 = vlib_get_buffer (vm, bi0); - h0 = (void *) (b0->data + b0->current_data); + h0 = vlib_buffer_get_current (b0); len0 = llc_header_length (h0); - b0->current_data += len0; - - b0->current_length -= len0; + vlib_buffer_advance (b0, len0); next0 = lm->input_next_by_protocol[h0->dst_sap]; -- cgit 1.2.3-korg