From: Ben Pfaff Date: Fri, 22 Jul 2011 00:03:03 +0000 (-0700) Subject: mac-learning: Fix inverted logic in is_learning_vlan(). X-Git-Tag: v1.2.0~27 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=82062a2047923e5c403fe42646e1c9eacbc73752 mac-learning: Fix inverted logic in is_learning_vlan(). When a bit is set in flood_vlans, that VLAN must be flooded, but the logic here was reversed in the case where there were any flooded VLANs at all. Thus, if a single VLAN was configured to be flooded, all VLANs except that one were actually flooded. The common case where no VLANs were to be flooded was handled correctly. Reported-by: David Tsai --- diff --git a/lib/mac-learning.c b/lib/mac-learning.c index bb84cfcc0..efd1dd4b8 100644 --- a/lib/mac-learning.c +++ b/lib/mac-learning.c @@ -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'.