Page MenuHomeFreeBSD

bridge: refactor local packet handling
Needs RevisionPublic

Authored by ivy on Jul 11 2025, 12:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 8, 1:35 PM
Unknown Object (File)
Sun, Feb 8, 11:42 AM
Unknown Object (File)
Sat, Feb 7, 8:37 PM
Unknown Object (File)
Sat, Feb 7, 8:03 PM
Unknown Object (File)
Sat, Jan 31, 2:50 PM
Unknown Object (File)
Jan 23 2026, 11:53 AM
Unknown Object (File)
Jan 18 2026, 11:14 PM
Unknown Object (File)
Dec 28 2025, 9:39 AM

Details

Reviewers
des
kevans
pouria
Group Reviewers
network
Summary

Remove the GRAB_OUR_PACKETS() macro and sprinkle its remains over
bridge_input():

  • check much earlier if we should punt the packet to vlan(4), or if it's filtered by pfil, or if we need to learn the address.
  • actual local packet handling is moved to a new function, bridge_try_local().

While here, change handling of frames received from discarding (STP)
ports to drop the frames instead of passing them to the host IP stack.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65357
Build 62240: arc lint + arc unit

Event Timeline

ivy requested review of this revision.Jul 11 2025, 12:15 PM

no need to call bridge_rtupdate() in bridge_forward() now

improve code a little; add more comments; ensure the bif is set correctly for netmap-injected frames

change the order of input processing: do filtering, then monitoring, then span,
so monitor and span see the same frames and don't see filtered frames.

improve some comments.

fix the member_ifaddrs_enabled test (the bridge needs to be up to pass frames now).

pouria requested changes to this revision.Wed, Feb 25, 2:20 PM
pouria added a reviewer: pouria.
pouria added a subscriber: pouria.

Could you please update this revision according to D51677.
This change looks good.
I'll review it if you update it again.

sys/net/if_bridge.c
2942–2944
This revision now requires changes to proceed.Wed, Feb 25, 2:20 PM

this diff is basically dead, in the sense it won't be committed as it, but i was planning to factor out some smaller changes from it into their own diffs. did not have time yet...