- if (~0 != gb->gb_uu_fwd_sw_if_index)
- set_int_l2_mode (vlib_get_main (), vnet_get_main (),
- MODE_L2_BRIDGE, gb->gb_uu_fwd_sw_if_index,
- bd_index, L2_BD_PORT_TYPE_UU_FWD, 0, 0);
+
+ if (!(flags & GBP_BD_FLAG_UU_FWD_DROP)
+ && ~0 != gb->gb_uu_fwd_sw_if_index)
+ {
+ set_int_l2_mode (vlib_get_main (), vnet_get_main (),
+ MODE_L2_BRIDGE, gb->gb_uu_fwd_sw_if_index,
+ bd_index, L2_BD_PORT_TYPE_UU_FWD, 0, 0);
+ }
+ if (!(flags & GBP_BD_FLAG_MCAST_DROP)
+ && ~0 != gb->gb_bm_flood_sw_if_index)
+ {
+ set_int_l2_mode (vlib_get_main (), vnet_get_main (),
+ MODE_L2_BRIDGE, gb->gb_bm_flood_sw_if_index,
+ bd_index, L2_BD_PORT_TYPE_NORMAL, 0, 0);
+ gbp_learn_enable (gb->gb_bm_flood_sw_if_index, GBP_LEARN_MODE_L2);
+ }
+
+ /*
+ * unset learning in the bridge + any flag(s) set above
+ */
+ bd_set_flags (vlib_get_main (), bd_index, bd_flags, 0);