From nobody Thu Jun 30 12:43:16 2022 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 D2D768AD04A; Thu, 30 Jun 2022 12:43:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LYdKc5bdjz4hNk; Thu, 30 Jun 2022 12:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656592996; 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=1aL9LctORcB07abzPvpodCRmbvMm/VReZ6it9daO77o=; b=sdMi8yrnoM8/Lhk6VbbnJzkcOX11R/Mo2+if2IxPjU3U7lGMDb0knj7sYtlsKZFVbdPt3z zqaawPWj8EyX5/E6uYZayzft9X/OmBVjs6j7uol8ZgJUhql6EGlkf7JrfodfoGus0Kuq7c GRGmXxrNQY3k3TXipVK8v65ApDdukSbcECBbQ+7P4wfl7Or6BbupTYs9m3d7DLAdoBv/LR 3iROle91G3iE5Mqj0caksqanSzcTn/oA0jM2G7Wn33n2eioqNEaArsM5ZeOuLAnRivZFSF cIH/bjVGRJAsJzPbd/TvuagxOerqpPdbSYolx7gDv+WZb+n01p2oxAQfiL8iTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 9FE502690B; Thu, 30 Jun 2022 12:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25UChGDH028777; Thu, 30 Jun 2022 12:43:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25UChGgf028776; Thu, 30 Jun 2022 12:43:16 GMT (envelope-from git) Date: Thu, 30 Jun 2022 12:43:16 GMT Message-Id: <202206301243.25UChGgf028776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c21cbaca2b0d - main - dummynet: handle IPV6 layer 2 traffic 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c21cbaca2b0db4eb6988da5c470cb520d82b17eb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656592996; 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=1aL9LctORcB07abzPvpodCRmbvMm/VReZ6it9daO77o=; b=nVPRcg5O7Egbl7hc5Z8v6i28ToT3dS6M9lI44WOQzfzkrU1JEqGr3Yg8wHdbtB+GAJ17eK 7Y9YDxRrTU+8Qf7ik3KbPpLyqJbxvzsmbpNKRA45+g+2ZX38OfRx7ILiVaeBj4GZhyecBj xQhNpuJtlUCChNoXgbDjS0rUJC5RSZHuvjE5jJPjtbblH07xFVJLMVknmFnozm8YnTVcZ/ OHviscePPnrGbRQixFeeLnu8Y5dmDX1TT52pKJxMcdTNOIN90BOdtJ3q+g0GZSDStS2afd HI2O2eMSNJN/NH7nLK0cqie4/gG/vVBZsPS7WZCaja2Y2a4u3zS8eJoHwgXCrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656592996; a=rsa-sha256; cv=none; b=j6Z4H7foileBkmYMvll3OJWCbCjxELgfb/KbWMEpo+dTxbWzHvwjIPiowka0gFUq1o3xip ziUJ9QRMMV3jNcL7iipq/iE64EBLNO5hl4V1xVoLf3NDfaBVx+ries3yEsZpPEJW+/W2vc Fn2Pfso0Fmcw1z0XaUOQ7M2tomZCZRiJXthPX5tIGFhEZ0rKUeAV71yAlKKKghl2fF7gAj 4hfUhNFT3vEVcFcyamH26eA0YE8z/A2ybC72cX/fdg/ol6TjrtSg5uP6SFdTgl+bgb0h7V eHLf4Y78hO0Yg3nmFCal0YjIF6c73b4wSbY7ulFQ05bLo+MojgBEg2X3ratNYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c21cbaca2b0db4eb6988da5c470cb520d82b17eb commit c21cbaca2b0db4eb6988da5c470cb520d82b17eb Author: Kristof Provost AuthorDate: 2022-06-30 11:34:53 +0000 Commit: Kristof Provost CommitDate: 2022-06-30 11:36:26 +0000 dummynet: handle IPV6 layer 2 traffic When pf sends layer 2 traffic into dummynet it still marks IPv6 with IPFW_ARGS_IPV6 (which dummynet translates to PROTO_V6). That in turn results in it not matching the 'DIR_IN | PROTO_LAYER2' case, and triggering the 'bad switch' error message. Add extra cases for LAYER2 | PROTO_IPV6. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/ipfw/ip_dn_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/ipfw/ip_dn_io.c b/sys/netpfil/ipfw/ip_dn_io.c index 98f9d08495df..deeb3d9325de 100644 --- a/sys/netpfil/ipfw/ip_dn_io.c +++ b/sys/netpfil/ipfw/ip_dn_io.c @@ -804,6 +804,7 @@ dummynet_send(struct mbuf *m) break; + case DIR_IN | PROTO_LAYER2 | PROTO_IPV6: case DIR_IN | PROTO_LAYER2: /* DN_TO_ETH_DEMUX: */ /* * The Ethernet code assumes the Ethernet header is @@ -819,6 +820,7 @@ dummynet_send(struct mbuf *m) ether_demux(m->m_pkthdr.rcvif, m); break; + case DIR_OUT | PROTO_LAYER2 | PROTO_IPV6: case DIR_OUT | PROTO_LAYER2: /* DN_TO_ETH_OUT: */ ether_output_frame(ifp, m); break;