]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: dsa: b53: skip multicast entries for fdb_dump()
authorJonas Gorski <jonas.gorski@gmail.com>
Wed, 17 Dec 2025 20:57:56 +0000 (21:57 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Sat, 27 Dec 2025 16:17:32 +0000 (17:17 +0100)
port_fdb_dump() is supposed to only add fdb entries, but we iterate over
the full ARL table, which also includes multicast entries.

So check if the entry is a multicast entry before passing it on to the
callback().

Additionally, the port of those entries is a bitmask, not a port number,
so any included entries would have even be for the wrong port.

Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20251217205756.172123-1-jonas.gorski@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/b53/b53_common.c

index a1a177713d99d6c6fb33e74a4b4aa357de24569d..2c4131ed7e30bf9a44569fea37773c84ac38d5f1 100644 (file)
@@ -2169,6 +2169,9 @@ static int b53_fdb_copy(int port, const struct b53_arl_entry *ent,
        if (!ent->is_valid)
                return 0;
 
+       if (is_multicast_ether_addr(ent->mac))
+               return 0;
+
        if (port != ent->port)
                return 0;