[Bug 270559] if_bridge: does not forward packets properly for vlan 1

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 02 Apr 2023 15:44:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270559

--- Comment #5 from Zhenlei Huang <zlei@FreeBSD.org> ---
(In reply to Kristof Provost from comment #4)

> I'd expect this to work, because the bridge code does take vlan ID into account
> when it learns addresses.

After looked into the code, I think the root cause is that if_bridge(4) treat
untagged packets as from vlan 1 (the default VID for bridge as 802.1Q-2003
Table 9-2), and untagged packets and that from vlan 1 share the same forwarding
lookup table. if_bridge(4) will then treat the two host from different
broadcast domain as the same one.

One possible solution could be treat untagged packets as untagged (or vlan 0)
and tagged as tagged. Although vlan 0 is not valid as per 802.1Q-2003 but it
has no side effect if user treat if_bridge(4) as transparent bridge. Actually
if_bridge(4) does not function as a full 802.1q aware bridge (I mean it misses
policies such as adding tags for inbound and removing tags on outbound or
dropping packets with unknown / un-configured tags).

> I translated your test into an automated test: https://reviews.freebsd.org/D39379 ,
> but that seems to pass. Did I miss something?
I'll comment directly on D39379.

-- 
You are receiving this mail because:
You are the assignee for the bug.