static bool
is_learning_vlan(const struct mac_learning *ml, uint16_t vlan)
{
- return vlan_bitmap_contains(ml->flood_vlans, vlan);
+ return !ml->flood_vlans || !bitmap_is_set(ml->flood_vlans, vlan);
}
/* Returns true if 'src_mac' may be learned on 'vlan' for 'ml'.
free(e);
}
-/* Expires all the mac-learning entries in 'ml'. The tags in 'ml' are
- * discarded, so the client is responsible for revalidating any flows that
- * depend on 'ml', if necessary. */
+/* Expires all the mac-learning entries in 'ml'. If not NULL, the tags in 'ml'
+ * are added to 'tags'. Otherwise the tags in 'ml' are discarded. The client
+ * is responsible for revalidating any flows that depend on 'ml', if
+ * necessary. */
void
-mac_learning_flush(struct mac_learning *ml)
+mac_learning_flush(struct mac_learning *ml, struct tag_set *tags)
{
struct mac_entry *e;
while (get_lru(ml, &e)){
+ if (tags) {
+ tag_set_add(tags, e->tag);
+ }
mac_learning_expire(ml, e);
}
hmap_shrink(&ml->table);