From nobody Mon Apr 10 15:56:39 2023 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 4PwD9h2N77z44Py6; Mon, 10 Apr 2023 15:56:40 +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 4PwD9h1WJMz3nPP; Mon, 10 Apr 2023 15:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681142200; 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=b2FDsRxUs3xzxuJwxBgcYMjZBAevsHTef3nFzObCJFc=; b=W1p+9S7J8lEKChFE87VdcWkpJyZM62Uxid633dFl5tqTfcOkLgBY5Sy9WpQbAJrkcUD6Mt KDhKDPQEuU/VL4YKUdgkW0iHHY3S1P7Ui95ld1pnr/cBmooFK2yyAIYwmkNKGODn743ekh efuoZD2Hkn5eZ0pEWAOJ5c2PyXjHMnXP+Oz2E7WizYVKtiGKRyAhlSrBXSsa2GbCAUGOCQ whj9KoILw95WLxXmpNoxFeqTrV5ipOGBrIof0h10G8ZwZHilYHl39v4boICYtlu2U04hIn dk5eRQtCtrLgwQd7aDoeAeBPvGecuVLu05oIzktLbnmkxntSQoo3wuK8sSdqNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681142200; 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=b2FDsRxUs3xzxuJwxBgcYMjZBAevsHTef3nFzObCJFc=; b=kRNuQ2FWOCU82MNUmyPDA/Sz1+9QlHbdbSJI4iG/b4ycdrma6pJ6ioIogTh5yLBiUBy5DU H9j4aeoFub6lw6T8fEVIZtpO4SyxEr9d1lV7GiEV/lr+YYjMDc6yf/ly92tssMRJpEen7d xAm18GnssRUOvMmBjEAjfAARtCig5CA9qH32xI1EEnNL/UxSi7eKBSTi4QnjDKODqKIxkI Jr7ph7t+K5igA7LxIqSeD03QhDTnQiGaDSvdjFL+aIQwJDGFtfS77iHQNMDy1vTgexpBJU sBOLQtJRIdZiYLBZrzaFdRh8Pe0crDpgqgTgIjGKxsZG2L0z22K2vmfmgoaF1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681142200; a=rsa-sha256; cv=none; b=xMpB9LOS/uWVeVTidfjQpVyjggvxNw/QqMC7WxzvQWZES52vuZ+DtRnqZNPc3vO9zyYHat al5dfzkN+IKmIiN7PAwX2RT5e6kdrgsZcF5Q44kII75NK85FaSAhMAWBHV55xC7WABjE3U U5DHEewbX7y5Z95W/u7xWhqixsj1+k2FRuncpnpvrYTUW6S0XUVsOSu7X/YH8INEIWuJ+5 OiwJlvDNnuDrBzlLcqez5QU1pApHgddUEXyOi4qmeC1teAdccFDSyRQ6pRrHXpV4C9YNUW yY6ysauUgbFlmHHhXznMwIQZ7HrPodCGnwwOgKokd6CBSEdRsS2A+SwKNkX7pg== 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 4PwD9h0bBFzwVN; Mon, 10 Apr 2023 15:56:40 +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 33AFudIA092721; Mon, 10 Apr 2023 15:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33AFudDM092720; Mon, 10 Apr 2023 15:56:39 GMT (envelope-from git) Date: Mon, 10 Apr 2023 15:56:39 GMT Message-Id: <202304101556.33AFudDM092720@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: c69ae8419734 - main - if_epair: also remove vlan metadata from mbufs 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: c69ae8419734829404bdb47d694d105c85f9835e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c69ae8419734829404bdb47d694d105c85f9835e commit c69ae8419734829404bdb47d694d105c85f9835e Author: Kristof Provost AuthorDate: 2023-04-10 11:02:55 +0000 Commit: Kristof Provost CommitDate: 2023-04-10 13:55:35 +0000 if_epair: also remove vlan metadata from mbufs We already remove mbuf tags from packets transitting an if_epair, but we didn't remove vlan metadata. In certain configurations this could lead to unexpected vlan tags turning up on the rx side. PR: 270736 Reviewed by: markj MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39482 --- sys/net/if_epair.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index aeed993249f5..e9e1a48b3d58 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -133,6 +133,8 @@ static struct epair_tasks_t epair_tasks; static void epair_clear_mbuf(struct mbuf *m) { + M_ASSERTPKTHDR(m); + /* Remove any CSUM_SND_TAG as ether_input will barf. */ if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { m_snd_tag_rele(m->m_pkthdr.snd_tag); @@ -140,6 +142,10 @@ epair_clear_mbuf(struct mbuf *m) m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; } + /* Clear vlan information. */ + m->m_flags &= ~M_VLANTAG; + m->m_pkthdr.ether_vtag = 0; + m_tag_delete_nonpersistent(m); }