Skip to content

Commit

Permalink
[show] Fix 'show mac' output, when FDB entry with Vlan 1 is present (#…
Browse files Browse the repository at this point in the history
…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 <Maksym_Belei@jabil.com>
  • Loading branch information
maksymbelei95 authored Mar 4, 2021
1 parent 64604db commit 748dbbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/fdbshow
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class FdbShow(object):
elif 'bvid' in fdb:
try:
vlan_id = port_util.get_vlan_id_from_bvid(self.db, fdb["bvid"])
if vlan_id is None:
# the situation could be faced if the system has an FDB entries,
# which are linked to default Vlan(caused by untagged trafic)
continue
except Exception:
vlan_id = fdb["bvid"]
print("Failed to get Vlan id for bvid {}\n".format(fdb["bvid"]))
Expand Down

0 comments on commit 748dbbf

Please sign in to comment.