From nobody Wed Sep 02 01:45:36 2026 X-Original-To: dev-commits-src-all@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 4hZQY22xNxz6qNrP for ; Wed, 02 Sep 2026 01:45:42 +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 4hZQY20qrrz3j2t for ; Wed, 02 Sep 2026 01:45:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788313542; 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=CGEDmnFyrGyY6FvWVs3IAWELdCmky14VAHe2dQ4qq0xX2qMgrm42IoBorz6dEzs3luL2aS ks5XqaqKJJM/wjxqCE9fNpjqUJ9TS7ujnufqM4zjnqeSDKTn2DlkC/wGo00Tawliheg9Xo hGAaishoIwgMGyO2m0hlO9YpzXZiKadKU5tQHeYdo40UQir+nysKm40WhHsTgRbj68tJAb k8a0i87HyVprl6cZh0AKy9tt6OJigEuo/lgp32K5eF0yQBMWcylrssCu4ut/5e/8y7dFL+ 1yQqY5KqT0pj27JHOAZt/wY8edYC5beW05m65m6DD8N7zFhAzvqUYA63KRyl9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788313542; a=rsa-sha256; cv=none; b=AbfBV9n1S01DQyRs8qQceaFa8UaO1PP+263KK9cOOMtVz8EsjcJzvTp28OuOpmAa7dzoXV jIT+coTsP9b38KbwpWT4qKSPOaEg4qiLC8FQrM6hrHvQ9dbQnfEd2Y5a9wKiD/pSQ5CmAg 81R4XHN9rpfW+Stmf6AadiWba4AP12ruAz8keDKsgyjZ/H3xVUQaSCYKSMLyMnmVHEqzsk NR8bta7IuSdH4mnXjsoKSmm0dfhJcWNYblMJNHNZomTBktb6cO9+D9CbMoZtFG7JUcMHt4 WJTCrG0g4cZdzym9AovRdNBaip7XkSLE78L7fAL0420yj6tRBsCM0Iwjt7Q11g== 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=1788313542; 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=LyNsOmcVTdiGBmb5QN++fAOlMFnNVItfgYeSxX24ba8kRKUcCDSj8z6XOloQgLzbSUW3NL iwFBdeSP0s9SkZIIM6CamUGqGDBGcSZ4tqn1+8DSN7vrZ1D6HeyJOD+13NvaNt/nQFur12 U9A2pJxfB84afWBgZcyR/eipnEvxYBps80Z9XfIRdwR7jeYZliFnGTstnV7lO+sCzOwiFD oQHc5zmAlXEgL632YlxkTak0YvMBUpF9DHpeMV/Bt3WWvkhlq+N8y1zPr7SF57hCP9lqjm sLw4RYjs+V76Uz4bB4e7PNga7q5KTn4KajGHXriNkOw4Gg9M4ICuFAidLxWcqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hZQY16MLKz73y for ; Wed, 02 Sep 2026 01:45:41 +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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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;