Skip to content

[show] Fix show arp in case with FDB entries, linked to default VLAN #1357

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

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

ghost
Copy link

@ghost ghost commented Jan 14, 2021

  • Adding condition to check result of getting of Vlan id, using bvid.
    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

  1. Assign IP address to the Ethernet interface:
    sudo config interface ip add Ethernet68 104.0.0.1/24
  2. Perform Steps to reproduce from Command "show arp" returns error: "int() argument must be a string, a bytes-like object or a number, not 'NoneType'" sonic-buildimage#6367. Start pinging from Linux host device. After that we will get FDB entry of Linux host device
  3. Remove IP address from the Ethernet interface:
    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)
  4. execute "show arp". The command should return normal output.

* Adding condition to check result of getting of Vlan id, using bvid.
  If the vlan id is None, then skip the record to avoid exception
  raising on int(NoneType)

Signed-off-by: Maksym Belei <[email protected]>
@prsunny
Copy link
Contributor

prsunny commented Jan 14, 2021

retest this please

@ghost
Copy link
Author

ghost commented Jan 18, 2021

Dear @prsunny,

Could I ask you to ping someone, who can merge this PR, as I have no rights to do that?

@prsunny prsunny merged commit 9bd709b into sonic-net:master Jan 19, 2021
@ghost ghost deleted the fix_show_arp branch January 19, 2021 06:35
anand-kumar-subramanian pushed a commit to anand-kumar-subramanian/sonic-utilities that referenced this pull request Mar 2, 2021
…onic-net#1357)

* Adding condition to check result of getting of Vlan id, using bvid.
  If the vlan id is None, then skip the record to avoid exception raising on int(NoneType)

Signed-off-by: Maksym Belei <[email protected]>
@qiluo-msft
Copy link
Contributor

201911 also needs this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants