FIB: store the node type not the function pointer.
[vpp.git] / src / vnet / vxlan-gpe / vxlan_gpe.c
index 3a92c88..b13a734 100644 (file)
@@ -83,6 +83,9 @@ u8 * format_vxlan_gpe_tunnel (u8 * s, va_list * args)
       s = format (s, "next-protocol unknown %d", t->protocol);
     }
 
+  if (ip46_address_is_multicast (&t->remote))
+    s = format (s, "mcast_sw_if_index %d ", t->mcast_sw_if_index);
+    
   s = format (s, " fibs: (encap %d, decap %d)",
               t->encap_fib_index,
               t->decap_fib_index);
@@ -180,9 +183,7 @@ vxlan_gpe_tunnel_restack_dpo(vxlan_gpe_tunnel_t * t)
 static vxlan_gpe_tunnel_t *
 vxlan_gpe_tunnel_from_fib_node (fib_node_t *node)
 {
-#if (CLIB_DEBUG > 0)
     ASSERT(FIB_NODE_TYPE_VXLAN_GPE_TUNNEL == node->fn_type);
-#endif
     return ((vxlan_gpe_tunnel_t*) (((char*)node) -
                               STRUCT_OFFSET_OF(vxlan_gpe_tunnel_t, node)));
 }
@@ -635,7 +636,7 @@ int vnet_vxlan_gpe_add_del_tunnel
               fib_node_index_t mfei;
               adj_index_t ai;
               fib_route_path_t path = {
-                  .frp_proto = fp,
+                  .frp_proto = fib_proto_to_dpo(fp),
                   .frp_addr = zero_addr,
                   .frp_sw_if_index = 0xffffffff,
                   .frp_fib_index = ~0,
@@ -1197,6 +1198,22 @@ VLIB_CLI_COMMAND (set_interface_ip6_vxlan_gpe_bypass_command, static) = {
 };
 /* *INDENT-ON* */
 
+/* *INDENT-OFF* */
+VNET_FEATURE_INIT (ip4_vxlan_gpe_bypass, static) =
+{
+  .arc_name = "ip4-unicast",
+  .node_name = "ip4-vxlan-gpe-bypass",
+  .runs_before = VNET_FEATURES ("ip4-lookup"),
+};
+
+VNET_FEATURE_INIT (ip6_vxlan_gpe_bypass, static) =
+{
+  .arc_name = "ip6-unicast",
+  .node_name = "ip6-vxlan-gpe-bypass",
+  .runs_before = VNET_FEATURES ("ip6-lookup"),
+};
+/* *INDENT-ON* */
+
 /**
  * @brief Feature init function for VXLAN GPE
  *