MPLS Mcast
[vpp.git] / src / vnet / adj / adj_nbr.c
index 61b5c83..3d450d1 100644 (file)
@@ -162,13 +162,12 @@ adj_nbr_evaluate_feature (adj_index_t ai)
     }
 
     sw_if_index = adj->rewrite_header.sw_if_index;
-    vec_validate (fm->feature_count_by_sw_if_index[arc_index], sw_if_index);
-    feature_count = fm->feature_count_by_sw_if_index[arc_index][sw_if_index];
-
-    if (feature_count > 0)
-        adj->rewrite_header.flags |= VNET_REWRITE_HAS_FEATURES;
-    else
-        adj->rewrite_header.flags &= ~VNET_REWRITE_HAS_FEATURES;
+    if (vec_len(fm->feature_count_by_sw_if_index[arc_index]) > sw_if_index)
+    {
+        feature_count = fm->feature_count_by_sw_if_index[arc_index][sw_if_index];
+        if (feature_count > 0)
+            adj->rewrite_header.flags |= VNET_REWRITE_HAS_FEATURES;
+    }
 
     return;
 }
@@ -196,8 +195,6 @@ adj_nbr_alloc (fib_protocol_t nh_proto,
     adj->ia_link = link_type;
     adj->ia_nh_proto = nh_proto;
     adj->rewrite_header.sw_if_index = sw_if_index;
-    memset(&adj->sub_type.midchain.next_dpo, 0,
-           sizeof(adj->sub_type.midchain.next_dpo));
 
     adj_nbr_evaluate_feature (adj_get_index(adj));
     return (adj);
@@ -334,7 +331,7 @@ adj_nbr_update_rewrite (adj_index_t adj_index,
  */
 void
 adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
-                                u32 adj_next_index,
+                                ip_lookup_next_t adj_next_index,
                                 u32 this_node,
                                 u32 next_node,
                                 u8 *rewrite)
@@ -368,7 +365,7 @@ adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
     if (ADJ_INDEX_INVALID != walk_ai)
     {
         walk_adj = adj_get(walk_ai);
-        if (IP_ADJ_SYNC_WALK_ACTIVE & walk_adj->ia_flags)
+        if (ADJ_FLAG_SYNC_WALK_ACTIVE & walk_adj->ia_flags)
         {
             do_walk = 0;
         }
@@ -377,7 +374,7 @@ adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
             /*
              * Prevent re-entrant walk of the same adj
              */
-            walk_adj->ia_flags |= IP_ADJ_SYNC_WALK_ACTIVE;
+            walk_adj->ia_flags |= ADJ_FLAG_SYNC_WALK_ACTIVE;
             do_walk = 1;
         }
     }
@@ -503,7 +500,7 @@ adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
      */
     if (do_walk)
     {
-        walk_adj->ia_flags &= ~IP_ADJ_SYNC_WALK_ACTIVE;
+        walk_adj->ia_flags &= ~ADJ_FLAG_SYNC_WALK_ACTIVE;
     }
 
     adj_unlock(adj_get_index(adj));