devices: fix crash on invalid interface
[vpp.git] / src / vnet / vxlan-gpe / vxlan_gpe.c
index 17ffcad..a926847 100644 (file)
@@ -544,7 +544,7 @@ int vnet_vxlan_gpe_add_del_tunnel
          vnet_interface_main_t *im = &vnm->interface_main;
          hw_if_index = ngm->free_vxlan_gpe_tunnel_hw_if_indices
            [vec_len (ngm->free_vxlan_gpe_tunnel_hw_if_indices) - 1];
-         _vec_len (ngm->free_vxlan_gpe_tunnel_hw_if_indices) -= 1;
+         vec_dec_len (ngm->free_vxlan_gpe_tunnel_hw_if_indices, 1);
 
          hi = vnet_get_hw_interface (vnm, hw_if_index);
          hi->dev_instance = t - ngm->tunnels;
@@ -645,17 +645,16 @@ int vnet_vxlan_gpe_add_del_tunnel
               *  - the forwarding interface is for-us
               *  - the accepting interface is that from the API
               */
-             mfib_table_entry_path_update (t->encap_fib_index,
-                                           &mpfx,
-                                           MFIB_SOURCE_VXLAN_GPE, &path);
+             mfib_table_entry_path_update (t->encap_fib_index, &mpfx,
+                                           MFIB_SOURCE_VXLAN_GPE,
+                                           MFIB_ENTRY_FLAG_NONE, &path);
 
              path.frp_sw_if_index = a->mcast_sw_if_index;
              path.frp_flags = FIB_ROUTE_PATH_FLAG_NONE;
              path.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT;
-             mfei = mfib_table_entry_path_update (t->encap_fib_index,
-                                                  &mpfx,
-                                                  MFIB_SOURCE_VXLAN_GPE,
-                                                  &path);
+             mfei = mfib_table_entry_path_update (
+               t->encap_fib_index, &mpfx, MFIB_SOURCE_VXLAN_GPE,
+               MFIB_ENTRY_FLAG_NONE, &path);
 
              /*
               * Create the mcast adjacency to send traffic to the group