From nobody Fri Sep 22 15:54:35 2023 X-Original-To: bugs@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 4RscK80b1Rz4v409 for ; Fri, 22 Sep 2023 15:54:36 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RscK75wFhz4Hgq for ; Fri, 22 Sep 2023 15:54:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695398075; a=rsa-sha256; cv=none; b=kAMlwgDn7ofdp6+lDqqBCVJ+fZusiJDUz6XYHSG1B7GfTU5+Vd+q65Gh5kwdkiLwQ6nn2Y Al9MP1ekq1LpRNHtlT2E/GMsri3EfYgs31JRjb4aOqaSSdVVKPqWz/PesKd1DMqTOGzIgT eEmpmWMn77DD8YTqT8mkjAY60Rokh1VYpMgYo9U27fcDRV0D8yJZ3DShbcudS6p72l2j8s mNYc9ZAMSr4e3oHggsUyjQAoG3xyU0EeRKhUiZOHSGZyyZs2GsAyVo1FdVi9tEOszS3RSp KL4LAYbC7KvD6qlbc5A3HNQ/KZ7ruJJsFwmRf/V/dDWHk7rH1o4q7Qs8Im59Qg== 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=1695398075; 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=BHNtxA00ewip6YfDwUNiO81tM92xLwnpGaIAx+fHRdM=; b=ETlLclDqocv4xoF62KwsjyFRHC/Qu06/RPQbVan62ZnSVzMITB29GPI2ThpD4JtNHZSBm3 6YF30bhMZ4Qmdn1/n8euhOHdru4R2NQbTEJ+CfGZcVQnvqdAucTslzHuvdDjkFObgcQpwC qtxQwzJCHm6NuxwvMN0WSGCIOMxEr42cYot8aMVhV7qTTsh/VE62ixYuhgEW/JACncx8Bo ZQUF0HMonYlA6vfKJ4fB7apEz+aUTI1yLrAmcu0Ej7UyZ0FexvNPibo9UEGYzj5YoRGsu0 sGgUzHMzjJqnyEsukD95q18HGO1Wd5hZ0AErrYUP1041vS2JXeKHZmSKl/aJKw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RscK74zlmzCpC for ; Fri, 22 Sep 2023 15:54:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38MFsZXx028590 for ; Fri, 22 Sep 2023 15:54:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38MFsZPE028589 for bugs@FreeBSD.org; Fri, 22 Sep 2023 15:54:35 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 274028] ng_bridge fails to learn MAC addresses if link is in different VNET Date: Fri, 22 Sep 2023 15:54:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dpslavov@hotmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274028 Bug ID: 274028 Summary: ng_bridge fails to learn MAC addresses if link is in different VNET Product: Base System Version: 13.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: dpslavov@hotmail.com In data receive method when MAC address save is requested a false assumptio= n is made that "curthread" is in same VNET as node, which of course is not always true. For example eiface is attached to a bridge and moved to different VNE= T: kldload ng_ether ngctl -f - << EOF mkpeer vtnet0: bridge lower uplink1 name vtnet0:lower switch0 mkpeer switch0: eiface link0 ether EOF jail -c path=3D/ vnet=3Dnew vnet.interface=3Dngeth0 persist host.hostname= =3Dtest name=3Dtest exec.start=3D"sh -c 'ifconfig ngeth0 inet 192.168.1.123/24; ifc= onfig ngeth0 up'" jexec test ping -c 1 192.168.1.254 ngctl msg switch0: gettable ngctl msg switch0: getstats 0 In this case failures are recorded as "memoryFailures". Fix: --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -911,8 +911,10 @@ ng_bridge_rcvdata(hook_p hook, item_p item) strncpy(mh->hook, NG_HOOK_NAME(ctx.incoming->hook), sizeof(mh->hook)); memcpy(mh->addr, eh->ether_shost, sizeof(mh->addr)); + CURVNET_SET(node->nd_vnet); NG_SEND_MSG_ID(error, node, msg, NG_NODE_ID(node), NG_NODE_ID(node)); + CURVNET_RESTORE(); if (error) counter_u64_add(ctx.incoming->stats.memoryFailures,= 1); } --=20 You are receiving this mail because: You are the assignee for the bug.=