[show] Fix show arp in case with FDB entries, linked to default VLAN #1357
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the vlan id is None, then skip the record to avoid exception
raising on int(NoneType)
Signed-off-by: Maksym Belei [email protected]
- What I did
Resolves sonic-net/sonic-buildimage#6367
Fix exception raising while executing "show arp" command in cases, when the system has an FDB entry, which is linked to default VLAN 1.
- How I did it
New condition has added to function "fetch_fdb_data" inside "nbrshow" script, which checks the result of getting "vlan_id" by using "bvid". If "vlan_id" is None, then just continue iterate "fdb_str", as a record inside "bridge_mac_list", which has not vlan_id, could not be using in any other places of "nbrshow" script.
- How to verify it
sudo config interface ip add Ethernet68 104.0.0.1/24
sudo config interface ip rem Ethernet68 104.0.0.1/24
This will cause creation of a new FDB entry with the same MAC address, but with oid of the default VLAN(oid:0x26000000000013)