From nobody Wed Apr 05 20:11:12 2023 X-Original-To: net@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 4PsG3k13MHz445cb for ; Wed, 5 Apr 2023 20:11:14 +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 4PsG3j5CMlz4Lt8 for ; Wed, 5 Apr 2023 20:11:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680725473; 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: in-reply-to:in-reply-to:references:references; bh=9+E48t6WVQ4dw6yUT4waF7LEGEd9xyA0aNGhQWKfqf8=; b=yi5GdCIm1U11IanL8ytGdroz3xdqhNY1ljMZClj0FrmwAlky1d+uCcdG/bo5V9wc9rPzXG PKVmC6gHisnt1uTdtOjGMHTz3zz5MkENw4W/uE+9C8BjRe7pNT+70CC9LJblQzdALWOq7t ar4Kqo3aHUPttiRH05bfhkw54ceZVa/H1SpU6uIoIoivzWvYghbMuJhnrsIbqYPcg0ZJWl KxTQdsgeXouwoq2D9U6TP5IB1BCMNEkBx0VqlsgI2wOF2LqFbQ710vqpfIggFjQY5slX4/ N5qUxbC0T2dTc8qhyfEouKIbMIRy5t31Mk8ZvQ7IDP+XXz7aTbZOxQLSIarZkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680725473; a=rsa-sha256; cv=none; b=gNnfIU7HrlFjo9IokCxjBCstAhncMet3SyFXmdK6UJ0ytytneFUwbF056MxFF0/OET1Xim GJ1mq9Cu1OXd6CVkWf61Glw/wQeJI6erRk5hzYKbwWF9Em3cbtRlqXmVEL5oUsGHCtpBRk SOE3PJTbNO/kkEebtfMXbOprTExT7rZKZ6gHPEewIBcckuOZvQfLsY1VvtWhgkSU1okKag xNsqmBioiZDxsyRMvfLDwwQ6Z6oAXQtMruTdYpeRbEkh7rEajyjlKVobBg2WA4Ryf6vatY Rq6FJUx0TS7Hibxh2pBsurpdKxXHN5d2k7dbR6dBdlvOdSTPCca+ooWg8afeYw== 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 4PsG3j42SVzbl6 for ; Wed, 5 Apr 2023 20:11:13 +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 335KBDkJ076784 for ; Wed, 5 Apr 2023 20:11:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 335KBDxw076783 for net@FreeBSD.org; Wed, 5 Apr 2023 20:11:13 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: net@FreeBSD.org Subject: [Bug 270559] if_bridge: does not forward packets properly for vlan 1 Date: Wed, 05 Apr 2023 20:11:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kp@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270559 Kristof Provost changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |philip@FreeBSD.org --- Comment #6 from Kristof Provost --- Yes, I believe your analysis is correct, as is your proposed approach for fixing it. With a bit of poking I got my test case to fail as you described, and with = the following patch it works again: diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 60a1683c74ae..5144da190a4f 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -389,7 +389,7 @@ static void bridge_linkcheck(struct bridge_softc *sc); /* The default bridge vlan is 1 (IEEE 802.1Q-2003 Table 9-2) */ #define VLANTAGOF(_m) \ - (_m->m_flags & M_VLANTAG) ? EVL_VLANOFTAG(_m->m_pkthdr.ether_vtag) : 1 + (_m->m_flags & M_VLANTAG) ? EVL_VLANOFTAG(_m->m_pkthdr.ether_vtag) : 0 static struct bstp_cb_ops bridge_ops =3D { .bcb_state =3D bridge_state_change, @@ -2783,10 +2783,6 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8= _t *dst, uint16_t vlan, dst[3] =3D=3D 0 && dst[4] =3D=3D 0 && dst[5] =3D=3D 0) !=3D 0) return (EINVAL); - /* 802.1p frames map to vlan 1 */ - if (vlan =3D=3D 0) - vlan =3D 1; - /* * A route for this destination might already exist. If so, * update it, otherwise create a new one. @@ -3118,7 +3114,7 @@ bridge_rtnode_lookup(struct bridge_softc *sc, const uint8_t *addr, uint16_t vlan hash =3D bridge_rthash(sc, addr); CK_LIST_FOREACH(brt, &sc->sc_rthash[hash], brt_hash) { dir =3D bridge_rtnode_addr_cmp(addr, brt->brt_addr); - if (dir =3D=3D 0 && (brt->brt_vlan =3D=3D vlan || vlan =3D= =3D 0)) + if (dir =3D=3D 0 && (brt->brt_vlan =3D=3D vlan)) return (brt); if (dir > 0) return (NULL); I assume you've got something similar? Do you want to post a review or shou= ld I post this one? Either way, we should copy philip@, because I remember him working on enhancing the bridge's support for vlans, so he may have useful things to say. --=20 You are receiving this mail because: You are the assignee for the bug.=