Skip to content

Commit 748dbbf

Browse files
author
maksymbelei95
authored
[show] Fix 'show mac' output, when FDB entry with Vlan 1 is present (#1368)
* Skip records of FDB entries, which are linked to default Vlan 1, to prevent exception throwing while performing command 'show mac' or 'fdbshow'. Signed-off-by: Maksym Belei <[email protected]>
1 parent 64604db commit 748dbbf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/fdbshow

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ class FdbShow(object):
8787
elif 'bvid' in fdb:
8888
try:
8989
vlan_id = port_util.get_vlan_id_from_bvid(self.db, fdb["bvid"])
90+
if vlan_id is None:
91+
# the situation could be faced if the system has an FDB entries,
92+
# which are linked to default Vlan(caused by untagged trafic)
93+
continue
9094
except Exception:
9195
vlan_id = fdb["bvid"]
9296
print("Failed to get Vlan id for bvid {}\n".format(fdb["bvid"]))

0 commit comments

Comments
 (0)