ip: Replace Sematics for Interface IP addresses
[vpp.git] / src / vnet / srp / node.c
index cf9bd31..6b76025 100644 (file)
@@ -167,8 +167,8 @@ srp_input (vlib_main_t * vm,
          b0 = vlib_get_buffer (vm, bi0);
          b1 = vlib_get_buffer (vm, bi1);
 
-         s0 = (void *) (b0->data + b0->current_data);
-         s1 = (void *) (b1->data + b1->current_data);
+         s0 = vlib_buffer_get_current (b0);
+         s1 = vlib_buffer_get_current (b1);
 
          /* Data packets are always assigned to side A (outer ring) interface. */
          sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
@@ -229,7 +229,7 @@ srp_input (vlib_main_t * vm,
 
          b0 = vlib_get_buffer (vm, bi0);
 
-         s0 = (void *) (b0->data + b0->current_data);
+         s0 = vlib_buffer_get_current (b0);
 
          /* Data packets are always assigned to side A (outer ring) interface. */
          sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
@@ -333,8 +333,7 @@ srp_topology_packet (vlib_main_t * vm, u32 sw_if_index, u8 ** contents)
     u32 * to_next;
     u32 bi = ~0;
 
-    if (vlib_buffer_add_data (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX,
-                              /* buffer to append to */ &bi,
+    if (vlib_buffer_add_data (vm, /* buffer to append to */ &bi,
                               *contents, vec_len (*contents)))
       {
         /* complete or partial buffer allocation failure */
@@ -403,7 +402,7 @@ srp_control_input (vlib_main_t * vm,
 
          b0 = vlib_get_buffer (vm, bi0);
 
-         s0 = (void *) (b0->data + b0->current_data);
+         s0 = vlib_buffer_get_current(b0);
          l2_len0 = vlib_buffer_length_in_chain (vm, b0);
          l3_len0 = l2_len0 - STRUCT_OFFSET_OF (srp_generic_control_header_t, control);
 
@@ -628,9 +627,8 @@ static void tx_ips_packet (srp_interface_t * si,
     = ~ip_csum_fold (ip_incremental_checksum (0, &i->control,
                                              sizeof (i[0]) - STRUCT_OFFSET_OF (srp_ips_header_t, control)));
 
-  if (vlib_buffer_add_data (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX,
-                            /* buffer to append to */ &bi,
-                            i, sizeof (i[0])))
+  if (vlib_buffer_add_data (vm, /* buffer to append to */ &bi, i,
+                           sizeof (i[0])))
     {
       /* complete or partial allocation failure */
       if (bi != ~0)