]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: b53: Lookup VID in ARL searches when VLAN is enabled
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 21 Apr 2020 03:26:51 +0000 (20:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Apr 2020 19:50:41 +0000 (12:50 -0700)
When VLAN is enabled, and an ARL search is issued, we also need to
compare the full {MAC,VID} tuple before returning a successful search
result.

Fixes: 42c5927a3531 ("net: dsa: b53: Implement ARL add/del/dump operations")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c

index 68e2381694b9ebd217a8e31debddcc7097ef6caa..fa9b9aca7b56039c20366a9b381f05c818bb92ef 100644 (file)
@@ -1505,6 +1505,9 @@ static int b53_arl_read(struct b53_device *dev, u64 mac,
                        continue;
                if ((mac_vid & ARLTBL_MAC_MASK) != mac)
                        continue;
+               if (dev->vlan_enabled &&
+                   ((mac_vid >> ARLTBL_VID_S) & ARLTBL_VID_MASK) != vid)
+                       continue;
                *idx = i;
        }