mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
net: dsa: qca8k: fix mdb add/del case with 0 VID
commitdfd739f182upstream. The qca8k switch doesn't support using 0 as VID and require a default VID to be always set. MDB add/del function doesn't currently handle this and are currently setting the default VID. Fix this by correctly handling this corner case and internally use the default VID for VID 0 case. Fixes:ba8f870dfa("net: dsa: qca8k: add support for mdb_add/del") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
828f9526f0
commit
aedec6019d
@@ -853,6 +853,9 @@ int qca8k_port_mdb_add(struct dsa_switch *ds, int port,
|
|||||||
const u8 *addr = mdb->addr;
|
const u8 *addr = mdb->addr;
|
||||||
u16 vid = mdb->vid;
|
u16 vid = mdb->vid;
|
||||||
|
|
||||||
|
if (!vid)
|
||||||
|
vid = QCA8K_PORT_VID_DEF;
|
||||||
|
|
||||||
return qca8k_fdb_search_and_insert(priv, BIT(port), addr, vid,
|
return qca8k_fdb_search_and_insert(priv, BIT(port), addr, vid,
|
||||||
QCA8K_ATU_STATUS_STATIC);
|
QCA8K_ATU_STATUS_STATIC);
|
||||||
}
|
}
|
||||||
@@ -865,6 +868,9 @@ int qca8k_port_mdb_del(struct dsa_switch *ds, int port,
|
|||||||
const u8 *addr = mdb->addr;
|
const u8 *addr = mdb->addr;
|
||||||
u16 vid = mdb->vid;
|
u16 vid = mdb->vid;
|
||||||
|
|
||||||
|
if (!vid)
|
||||||
|
vid = QCA8K_PORT_VID_DEF;
|
||||||
|
|
||||||
return qca8k_fdb_search_and_del(priv, BIT(port), addr, vid);
|
return qca8k_fdb_search_and_del(priv, BIT(port), addr, vid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user