Skip to content

Commit ce9a36e

Browse files
authored
Get Vlan Id from SAI Vlan Object if bvid present (#196)
* Get Vlan Id from ASIC_STATE Vlan Object if bvid present
1 parent 71c696e commit ce9a36e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/fdbshow

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ class FdbShow(object):
7575
continue
7676
port_id = self.if_br_oid_map[br_port_id]
7777
if_name = self.if_oid_map[port_id]
78-
79-
self.bridge_mac_list.append((int(fdb["vlan"]),) + (fdb["mac"],) + (if_name,))
78+
if 'vlan' in fdb:
79+
vlan_id = fdb["vlan"]
80+
elif 'bvid' in fdb:
81+
vlan_id = port_util.get_vlan_id_from_bvid(self.db, fdb["bvid"])
82+
self.bridge_mac_list.append((int(vlan_id),) + (fdb["mac"],) + (if_name,))
8083

8184
self.bridge_mac_list.sort(key = lambda x: x[0])
8285
return

0 commit comments

Comments
 (0)