aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/llc/node.c
diff options
context:
space:
mode:
authorZhiyong Yang <zhiyong.yang@intel.com>2019-05-28 00:57:39 -0400
committerDamjan Marion <dmarion@me.com>2019-05-28 08:10:01 +0000
commitd7d24990a0cafc70909106f4fc9b6fb4480c3aa0 (patch)
tree084da87995a69afc83c63bf13813d6b6673bb1bc /src/vnet/llc/node.c
parent21dc4ece174006a779436362b12d539a91404c8e (diff)
llc_input: simplify code using existing functions
Change-Id: I3906adf9aa20b4221eeb7a8b5b353c6f0cb32d04 Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Diffstat (limited to 'src/vnet/llc/node.c')
-rw-r--r--src/vnet/llc/node.c17
1 files changed, 6 insertions, 11 deletions
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];