Page MenuHomeFreeBSD

ng_bridge: do not move hosts from learnMac=0 hooks
Needs ReviewPublic

Authored by dteske on Tue, Aug 18, 5:16 AM.
Tags
None
Referenced Files
F167473242: D58902.diff
Sat, Aug 22, 1:06 AM
Unknown Object (File)
Tue, Aug 18, 3:55 PM
Unknown Object (File)
Tue, Aug 18, 3:54 PM

Details

Reviewers
adrian
emaste
julian
donner
kp
Group Reviewers
network
manpages
Summary

ng_bridge(4) says the node does not learn MAC addresses on uplink
hooks. However, learnMac was only checked when inserting a new
host. A host already known on a link hook was still moved if a
packet with that source address arrived on an uplink hook.

The nature of this is that inbound unicast to that host then
never arrives (the destination is known on the incoming hook).
Unknown unicast after timeout is still sent only to uplink, so
the host is not re-learned. The interface stays up and outbound
may still work. This can last minutes or weeks until reboot or
NGM_BRIDGE_MOVE_HOST.

Connecting ng_ether(4) lower to an uplink hook is enough: the
host's own transmit can appear on the uplink and the table entry
moves.

Use the same learnMac test for data-path move as for insert.
NGM_BRIDGE_MOVE_HOST from userland is unchanged.

MFC after: 1 week

Diff Detail

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

Event Timeline

the whole uplink thing worries me a bit but I guess it's ok..

share/man/man4/ng_bridge.4
100

Not your issue but just a suggestion.. while you are there can you fix this?

I didn't write this one (that was Archie) so I was learning as I read the man page. It was not obvious to me that "uplinkx" is a magic name and that calling something "uplink(x): makes it behave differently. the page does not explicitly say this but it doesn't. I went right past the comment saying that one MIGHT name it uplinkX.. as if tha was an aesthetic choice.. it shoud say "If one uses the special prefix "uplink" then the hook is marked as an uplink hook and behaves differently" ,,,
I went away from there wondering "how does one mark is as uplink???"

unless of course I missed it.

share/man/man4/ng_bridge.4
100

In Feb 2021, Lutz added the magic uplink name, here:

https://cgit.freebsd.org/src/commit/share/man/man4/ng_bridge.4?id=f961caf2184c94d6f59c8d522207156b3533d977

I switched over to using it in 2024 because I noticed the immediate value-add as documented in the man-page update (see HOOKS section):

node does not learn MAC addresses on uplink hooks, which keeps the internal address table small

As for the "while you are there" -- absolutely. I'll take that on. It's a good suggestion.