L2FWD:fix seq_num overwritten + validate l2fib entries when forwarding
[vpp.git] / src / vnet / l2 / l2_input.h
index f3fada6..c1b669b 100644 (file)
@@ -86,6 +86,17 @@ l2input_bd_config_from_index (l2input_main_t * l2im, u32 bd_index)
   return bd_is_valid (bd_config) ? bd_config : NULL;
 }
 
+static_always_inline l2_bridge_domain_t *
+l2input_bd_config (u32 bd_index)
+{
+  l2input_main_t *mp = &l2input_main;
+  l2_bridge_domain_t *bd_config;
+
+  vec_validate (mp->bd_configs, bd_index);
+  bd_config = vec_elt_at_index (mp->bd_configs, bd_index);
+  return bd_config;
+}
+
 /* L2 input indication packet is from BVI, using -2 */
 #define L2INPUT_BVI ((u32) (~0-1))
 
@@ -114,6 +125,11 @@ typedef enum
   foreach_l2input_feat
 #undef _
     L2INPUT_N_FEAT,
+  L2INPUT_VALID_MASK =
+#define _(sym,str) L2INPUT_FEAT_##sym##_BIT |
+    foreach_l2input_feat
+#undef _
+    0,
 } l2input_feat_t;
 
 /* Feature bit masks */