llc_input: simplify code using existing functions
@@ -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];
