Skip to content

linklayer: refactor: no default VLAN ID in the MAC forwarding table API - #1389

Merged
levy merged 1 commit into
masterfrom
topic/mactable-explicit-vlan
Oct 28, 2026
Merged

levy merged 1 commit into
masterfrom
topic/mactable-explicit-vlan

Conversation

@avarga

@avarga avarga commented Oct 27, 2026

Copy link
Copy Markdown
Member

Deletes the =0 default values from unsigned int vid arguments in VLAN-related methods of MacForwardingTable.
Every caller in INET already passes the VLAN ID, so no additional adjustment was needed, and the simulations do not change.

Before this commit, the lookup and update methods of IMacForwardingTable, their overrides in MacForwardingTable, and the MRP-specific methods of MrpMacForwardingTable defaulted the VLAN ID to 0. A caller that forgot the VLAN of the frame compiled and silently used VLAN 0. The classic relays looked up destinations that way until d141d3f ("linklayer: fix: relays look up destinations in the VLAN of the frame"), and flooded tagged unicast frames, or sent them to a port learned for another VLAN.

After this commit, every caller passes the VLAN ID, and a call without one does not compile. Every caller in INET already passes it, so the simulation does not change. Code outside INET that calls these methods without a VLAN ID must now pass one: 0 for VLAN-unaware use. The release note says so.

Change: src.linklayer | refactor | whatsnew
@levy
levy merged commit 03bd98c into master Oct 28, 2026
16 of 17 checks passed
@avarga
avarga deleted the topic/mactable-explicit-vlan branch October 28, 2026 09:02
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