Page MenuHomeFreeBSD

D58902.id185534.diff
No OneTemporary

D58902.id185534.diff

diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4
--- a/share/man/man4/ng_bridge.4
+++ b/share/man/man4/ng_bridge.4
@@ -32,7 +32,7 @@
.\"
.\" Author: Archie Cobbs <archie@FreeBSD.org>
.\"
-.Dd April 8, 2024
+.Dd August 31, 2026
.Dt NG_BRIDGE 4
.Os
.Sh NAME
@@ -91,12 +91,20 @@
.Xr ng_ether 4
node to the bridge node.
.Pp
-Instead of naming a hook
-.Ar linkX
-the hook might be also named
-.Ar uplinkX .
+The prefix
+.Dq uplink
+is special: a hook named
+.Ar uplinkX
+is marked as an uplink hook and behaves differently from
+.Ar linkX .
The node does not learn MAC addresses on uplink hooks, which keeps
the internal address table small.
+A host already known on a
+.Ar linkX
+hook is not moved when a packet with that source address
+arrives on an uplink hook; use
+.Dv NGM_BRIDGE_MOVE_HOST
+to place a host on an uplink hook explicitly.
This way it is desirable to connect the
.Ar lower
hook of an
diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c
--- a/sys/netgraph/ng_bridge.c
+++ b/sys/netgraph/ng_bridge.c
@@ -858,8 +858,12 @@
if (__predict_false(host->staleness > 0))
host->staleness = 0;
- if ((host == NULL && ctx.incoming->learnMac) ||
- (host != NULL && host->link != ctx.incoming)) {
+ /*
+ * learnMac is 0 on uplink: neither insert a new host nor
+ * move an existing one from packets received there.
+ */
+ if (ctx.incoming->learnMac &&
+ (host == NULL || host->link != ctx.incoming)) {
struct ng_mesg *msg;
struct ng_bridge_move_host *mh;
int error = 0;

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 13, 7:58 AM (16 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38737139
Default Alt Text
D58902.id185534.diff (1 KB)

Event Timeline