netdev-linux: Add MTU check before setting MTU.
[openvswitch] / lib / mac-learning.c
index bb84cfcc0b1ecba84db378c96041ea97ce3d84e0..7872e2b97e6cfa3a205b2ff92c13d57ff5a62bb4 100644 (file)
@@ -149,7 +149,7 @@ mac_learning_set_flood_vlans(struct mac_learning *ml,
 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'.
@@ -260,14 +260,18 @@ mac_learning_expire(struct mac_learning *ml, struct mac_entry *e)
     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);