// Init bridge domain if not done already
// For feature bitmap, set all bits except ARP termination
-inline void
+void
bd_validate (l2_bridge_domain_t * bd_config)
{
if (!bd_is_valid (bd_config)) {
uword * p;
u32 rv;
- p = hash_get (bdm->bd_index_by_bd_id, bd_id);
- if (p)
- return (p[0]);
+ if (bd_id == ~0) {
+ bd_id = 0;
+ while (hash_get (bdm->bd_index_by_bd_id, bd_id))
+ bd_id++;
+ } else {
+ p = hash_get (bdm->bd_index_by_bd_id, bd_id);
+ if (p)
+ return (p[0]);
+ }
rv = clib_bitmap_first_clear (bdm->bd_index_bitmap);