-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show mac learned on lag interface #730
Conversation
scripts/fdbshow
Outdated
@@ -76,7 +78,10 @@ class FdbShow(object): | |||
if br_port_id not in self.if_br_oid_map: | |||
continue | |||
port_id = self.if_br_oid_map[br_port_id] | |||
if_name = self.if_oid_map[port_id] | |||
if port_id.startswith("1"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think this assumption can be hard-coded here. You can check if the port_id exists in lag_if_oid_map
, if so fetch from that and if not, get from if_oid_map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi prsunny,
It is a very good suggestion, I have modified and tested the modifaction. The new commit is 6f281af.
Thanks.
retest this please |
This is the new test result yesterday: root@sonic:/home/admin# show mac
Total number of entries 2 |
I see that the commit sonic-net/sonic-py-swsssdk#51 will also fix the error. But I think a better modification is to provide API with a unique function such as API to get oid-map for interface/lag/bridge_port/vlan. |
This change is needed in nbrshow as well.. "show arp" has exact same issue. thanks, |
Merged, this - sonic-net/sonic-py-swsssdk#51. I think this should fix both fdb and nbr show. |
Retest this please |
@JiangboHe , can we close this PR as the fix is merged? |
- What I did
The code is to show mac learned on lag.
The funtion need to read the LAG_NAME_MAP_TABLE data.
- How I did it
To read mac table and get its learned portchannel name from LAG_NAME_MAP_TABLE in COUNTERS_DB with oid.
- How to verify it
- Previous command output (if the output of a command-line utility has changed)
root@sonic:/home/admin# show mac
2000000000658
- New command output (if the output of a command-line utility has changed)
root@sonic:/home/admin# show mac
No. Vlan MacAddress Port Type