session: API cleanup
[vpp.git] / src / vnet / mpls / mpls_api.c
index cb20df5..0185e37 100644 (file)
@@ -192,13 +192,13 @@ mpls_route_add_del_t_handler (vnet_main_t * vnm,
        goto out;
     }
 
-  fib_api_route_add_del (mp->mr_is_add,
-                        mp->mr_is_multipath,
-                        fib_index,
-                        &pfx,
-                        (mp->mr_route.mr_is_multicast ?
-                         FIB_ENTRY_FLAG_MULTICAST :
-                         FIB_ENTRY_FLAG_NONE), rpaths);
+  rv = fib_api_route_add_del (mp->mr_is_add,
+                             mp->mr_is_multipath,
+                             fib_index,
+                             &pfx,
+                             (mp->mr_route.mr_is_multicast ?
+                              FIB_ENTRY_FLAG_MULTICAST :
+                              FIB_ENTRY_FLAG_NONE), rpaths);
 
   if (mp->mr_is_add && 0 == rv)
     *stats_index = fib_table_entry_get_stats_index (fib_index, &pfx);
@@ -360,7 +360,7 @@ send_mpls_tunnel_entry (u32 mti, void *arg)
   mp->_vl_msg_id = ntohs (VL_API_MPLS_TUNNEL_DETAILS);
   mp->context = ctx->context;
 
-  mp->mt_tunnel.mt_n_paths = ntohl (n);
+  mp->mt_tunnel.mt_n_paths = n;
   mp->mt_tunnel.mt_sw_if_index = ntohl (mt->mt_sw_if_index);
   mp->mt_tunnel.mt_tunnel_index = ntohl (mti);
   mp->mt_tunnel.mt_l2_only = ! !(MPLS_TUNNEL_FLAG_L2 & mt->mt_flags);
@@ -550,7 +550,7 @@ setup_message_id_table (api_main_t * am)
 static clib_error_t *
 mpls_api_hookup (vlib_main_t * vm)
 {
-  api_main_t *am = &api_main;
+  api_main_t *am = vlibapi_get_main ();
 
 #define _(N,n)                                                  \
     vl_msg_api_set_handlers(VL_API_##N, #n,                     \