diff options
author | Zhiyong Yang <zhiyong.yang@intel.com> | 2019-05-28 00:57:39 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-05-28 08:10:01 +0000 |
commit | d7d24990a0cafc70909106f4fc9b6fb4480c3aa0 (patch) | |
tree | 084da87995a69afc83c63bf13813d6b6673bb1bc /src | |
parent | 21dc4ece174006a779436362b12d539a91404c8e (diff) |
llc_input: simplify code using existing functions
Change-Id: I3906adf9aa20b4221eeb7a8b5b353c6f0cb32d04
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/llc/node.c | 17 |
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]; |