From nobody Wed Sep 02 01:45:36 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hZQXx0ZpVz6qNrM for ; Wed, 02 Sep 2026 01:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hZQXx039Hz3hpG for ; Wed, 02 Sep 2026 01:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788313537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEPkIT13wnTtVJhvUSA+XWYYzYPRwkmkG0heU7WwIxE=; b=aqzmi7IHcwaf320YjoXQWMB04oFAKkf7H9Mj6JJzL6PqxVeFOAfb9u48HLlSXpcmg+mdaZ Z//uglO58okg8fDMvkjij8wm4V6tWNmEgz2bbbVQsG4FVQErt23rZej476EZvotmGGzpoN ts+QYbKg/PcqhByl+iL4hmxyhnL9Vade5qzF8rANahn/ndUVKMZDSLBATrZlJt/Odvdde+ NO+NvP/EMMMssMHhsYywQl/hpmORLjCqtyUaMlkQxbJzIwo4m508TVlOgaGv8Pi4v51bHT 0MumsJ2gEDWmM6jucHu3fTFkd//kLt1L3aNHSHV22wL/138HSvy3tsmzvxTLCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788313537; a=rsa-sha256; cv=none; b=BjgShoca8K5MvxcbwBVvbZfGzA5cbFb6nXY1D1oLTtFZBCJlvoD3w2npF+fdgyzd+x6gLX PptXdIEcwPJ03kT7MgoPALHr4fezVRK3OgitQgpXi7bKzqPW1DvDp0x1va/DEBEtPfdL1r cMtjwK13vnb7oPc4bsaO+1AtJ/JlceF2+0jv8Ivg2Ga24F239SMB6enxn5JGes/mDAtUOa nvxtoCy2C8ZFAsn17wroKl10ypQKU2FeB1GyRMOy9GPEgBpk+gNjUZgRP2Ky+zOejEy4cl 9jaUltREUTeB+8Gy36yMHtmpIf55+eZ0gC/aF/enW3PZ9YgEkdNcS+SDA3e9HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788313537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEPkIT13wnTtVJhvUSA+XWYYzYPRwkmkG0heU7WwIxE=; b=Fm8Srhii2PIwNRnipO7bJp8xFDU/E/vLZ76eisTGBbc6SLP9ULzmXOxEd3f5qkpq0mgpiF 1hPfApIvquudL7nde01pD8aOWAVhnClCImGdoM4JkQItB9C+Mfodl98upn40n8tDpBrPM+ 6NIzLMxqBXT1xTq/zmKlBiA3rN4mUiQ6A2/RWmqfHLrHKIIJpgjKL6kPZwPAIJw2allwDj 1VwK9uUaJXHdfTEmDOrfs9yJaktnNZUZA+9pr+8LTrlEBpHs2t97JzNCmym7G6BE9p+6nF S9No75vRotLwoDc0M4gBIGa53OWsjPVZ1R4eydRUO6rCs3Z7pkoiwka8gXoiXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hZQXw5ZWwz73x for ; Wed, 02 Sep 2026 01:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2133d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 02 Sep 2026 01:45:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 4690891af632 - main - ng_bridge: do not move hosts from learnMac=0 hooks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4690891af6320e358e4a2beb3054cd37d065d8d2 Auto-Submitted: auto-generated Date: Wed, 02 Sep 2026 01:45:36 +0000 Message-Id: <6a977fc0.2133d.5f0fcffc@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=4690891af6320e358e4a2beb3054cd37d065d8d2 commit 4690891af6320e358e4a2beb3054cd37d065d8d2 Author: Devin Teske AuthorDate: 2026-09-02 01:43:21 +0000 Commit: Devin Teske CommitDate: 2026-09-02 01:43:21 +0000 ng_bridge: do not move hosts from learnMac=0 hooks 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 Reviewed by: jlduran Differential Revision: https://reviews.freebsd.org/D58902 --- share/man/man4/ng_bridge.4 | 18 +++++++++++++----- sys/netgraph/ng_bridge.c | 8 ++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 998c428cbad0..bc5b03ed0f00 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -32,7 +32,7 @@ .\" .\" Author: Archie Cobbs .\" -.Dd April 8, 2024 +.Dd August 31, 2026 .Dt NG_BRIDGE 4 .Os .Sh NAME @@ -91,12 +91,20 @@ hook of an .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 index 70bc581f8570..7b84ed1f5420 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -858,8 +858,12 @@ ng_bridge_rcvdata(hook_p hook, item_p item) 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;