Skip to content

Commit 88e943e

Browse files
oleremdavem330
authored andcommitted
net: dsa: microchip: ksz8: fix ksz8_fdb_dump()
Before this patch, the ksz8_fdb_dump() function had several issues, such as uninitialized variables and incorrect usage of source port as a bit mask. These problems caused inaccurate reporting of vid information and port assignment in the bridge fdb. Fixes: e587be7 ("net: dsa: microchip: update fdb add/del/dump in ksz_common") Signed-off-by: Oleksij Rempel <[email protected]> Acked-by: Arun Ramadoss <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f336422 commit 88e943e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/net/dsa/microchip/ksz8795.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,15 +958,14 @@ int ksz8_fdb_dump(struct ksz_device *dev, int port,
958958
u16 entries = 0;
959959
u8 timestamp = 0;
960960
u8 fid;
961-
u8 member;
962-
struct alu_struct alu;
961+
u8 src_port;
962+
u8 mac[ETH_ALEN];
963963

964964
do {
965-
alu.is_static = false;
966-
ret = ksz8_r_dyn_mac_table(dev, i, alu.mac, &fid, &member,
965+
ret = ksz8_r_dyn_mac_table(dev, i, mac, &fid, &src_port,
967966
&timestamp, &entries);
968-
if (!ret && (member & BIT(port))) {
969-
ret = cb(alu.mac, alu.fid, alu.is_static, data);
967+
if (!ret && port == src_port) {
968+
ret = cb(mac, fid, false, data);
970969
if (ret)
971970
break;
972971
}

0 commit comments

Comments
 (0)