Skip to content

Fix 'show mac' output when FDB entry for default vlan is None instead of 1 #2126

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 2 commits into from
Apr 3, 2022

Conversation

busterswt
Copy link
Contributor

• Fixes an issue where VLAN ID of None results in "int() argument must be a string, a bytes-like object or a number, not 'NoneType'" error.

Signed-off-by: James Denton [email protected]

What I did

Fixed "show mac" command execution failure when the system has an FDB entry linked to default Vlan 1 that cannot be looked up (returns None).

How I did it

If VLAN ID is None, assume it is 1 and allow the entry to be listed.

How to verify it

Pass traffic through an unconfigured interface and perform a 'show mac' or 'fdbshow' command.

Previous command output (if the output of a command-line utility has changed)

admin@sonic:~$ show mac
int() argument must be a string, a bytes-like object or a number, not 'NoneType'

New command output (if the output of a command-line utility has changed)

admin@sonic:~$ show mac
No. Vlan MacAddress Port Type


1       1  98:03:9B:BE:E9:68  Ethernet60    Dynamic
2       1  6C:3B:E5:BD:14:D0  Ethernet21    Dynamic
3       1  00:0C:29:E6:70:A2  Ethernet2     Dynamic
4       1  3C:FD:FE:9E:8A:C9  PortChannel2  Dynamic
5       1  6C:6C:D3:CC:04:41  Ethernet60    Dynamic
6       6  FA:16:3E:27:E2:C7  Ethernet2     Dynamic
7       6  6C:6C:D3:CC:04:33  Ethernet60    Dynamic
8      20  00:16:3E:22:62:4F  Ethernet2     Dynamic
9      20  00:16:3E:BF:84:84  Ethernet2     Dynamic

10 20 00:16:3E:50:A3:35 Ethernet2 Dynamic
11 20 00:16:3E:1A:74:BD Ethernet2 Dynamic
12 20 00:16:3E:37:EE:EC Ethernet2 Dynamic
13 20 00:16:3E:5A:71:A2 Ethernet2 Dynamic

@busterswt
Copy link
Contributor Author

VLAN 'None' (default/1) is now excluded:

admin@sonic:~$ fdbshow
No. Vlan MacAddress Port Type


1       6  FA:16:3E:27:E2:C7  Ethernet2   Dynamic
2       6  6C:6C:D3:CC:04:33  Ethernet60  Dynamic
3      20  00:16:3E:EE:64:C2  Ethernet2   Dynamic
4      20  00:16:3E:8E:31:F6  Ethernet2   Dynamic
5      20  00:16:3E:6D:BE:65  Ethernet2   Dynamic
6      20  00:16:3E:1A:74:BD  Ethernet2   Dynamic

...
48 23 9C:B6:54:96:07:5C Ethernet0 Dynamic
49 23 6C:3B:E5:BD:14:D4 Ethernet49 Dynamic
50 23 F0:92:1C:0D:9E:C4 Ethernet48 Dynamic
51 102 FA:16:3E:BF:FA:FD Ethernet20 Dynamic
52 102 E4:1F:7B:9A:FC:4B Ethernet60 Dynamic
53 102 6C:6C:D3:CC:04:33 Ethernet60 Dynamic

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

Successfully merging this pull request may close these issues.

2 participants