From nobody Wed Jun 28 01:33:10 2023 X-Original-To: dev-commits-src-branches@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 4QrPGv3KFNz4kxp7; Wed, 28 Jun 2023 01:33:11 +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 4QrPGt6khHz3DTJ; Wed, 28 Jun 2023 01:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687915991; 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=P6Px+PWKaFdGelQb2FtQ/RLCU6EksKBM5h8Pp7hjF3o=; b=JH3Q9nrAwpbUneBfm1Kt0buyUVytT66WVrTy3GlXVmkZTMfU9wEIyC3U8SEx2H7sMv9cbw 0Pmrm8cg5gBE+C/UXnwQrnjlKwELmUdL2rIY5fu7jiPsHeA8YNgA6npAqW8+3gt76QK+2m aV7yun5s62m0D32YjWpJM3z9fcmq1S10osRl/bpeZn6ogQ9ye7DUDNyhqZhPZqnTWdudfm PDIMNGnQ5SB2HIIz5vsBfNapXQfhRE3yieCoa4SAEIdKmIwsXrSTREzagIMPpwtkR4oJNy yhDsytVFnsw6sN081agoeYu/k4aYK6pAFyIDrOKAi0HqKV7sETfbzFhoTGBbOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687915991; 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=P6Px+PWKaFdGelQb2FtQ/RLCU6EksKBM5h8Pp7hjF3o=; b=b6lkGGQBvQ62a+nn5pz2brYmx3R1ACwNTvTPHb29C7OripphR/n5L2JNQTVrwHv1eBdCyA w2bXjtvizoOZtJLkIInxBfUdF/h4XVM6c6r6MxCyWJXTWELHUJXgcVfSKGX1dR2KvWxACe K3sXoobR2KvXMdQReaJ1ngtuu5ZD5KVjiqZZMr4DGKCbM5JEYDIZF76NCsQw3bzRIXw0yL j5ACVuJtAlBLXLq+FOUMlTyTQdpfnql4inSwlz9KRpKtvAadl+JiR0sEeUC2x4z2C+WACs GVLyXK7+Gbq+0e9sVn+gSwvV8EYajtjNFEAb/iizLU73eNv2wqk1f+6E9ObD6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687915991; a=rsa-sha256; cv=none; b=Ne9EcHS0k8hiC80PWW8d8nG+RBIfM4Bjxg4lP8TFdcY3QtpJ03Atfnzv4GrYS6qGb1JdV8 CT4rkWTF9Zpo8E6UH1J/lzMQ+5BuXWrdL8SFfrXiI9nrK0BpH4MTYSer2F0bEPkZwvRlMo TGUwqBIPiYNRev4zO4klXAlzl8vD1wLoqxiPTGumIW90SCePmYN6w0SKNnagHKyA/AMwMV FrZU7RCOXU+8oKwx04LzIYQUHnsn6GbRhuI5AROtSgyylAju05wKB72RpuLnhW1+kyng84 UQCzmhesgzlWKOKrW7kuTgFkHx20JYubl2W6x+kfISEg5f8S6/HogLAci4dCyg== 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 4QrPGt5SKYzFcm; Wed, 28 Jun 2023 01:33:10 +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 35S1XAoi045139; Wed, 28 Jun 2023 01:33:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35S1XApw045138; Wed, 28 Jun 2023 01:33:10 GMT (envelope-from git) Date: Wed, 28 Jun 2023 01:33:10 GMT Message-Id: <202306280133.35S1XApw045138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ed19cb27bde8 - stable/13 - ether_demux: Defer stripping the Ethernet header. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed19cb27bde8c87ece83e390b0fd40991abdc9b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ed19cb27bde8c87ece83e390b0fd40991abdc9b3 commit ed19cb27bde8c87ece83e390b0fd40991abdc9b3 Author: John Baldwin AuthorDate: 2022-11-30 22:38:51 +0000 Commit: John Baldwin CommitDate: 2023-06-28 01:32:47 +0000 ether_demux: Defer stripping the Ethernet header. This avoids having to undo it before invoking NetGraph's orphan input hook. Reviewed by: ae, melifaro Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D37510 (cherry picked from commit 79b679942352a7f10d759fdee1892aa251e0f439) --- sys/net/if_ethersubr.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 25daf13ccef6..9a614fbe6844 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -886,11 +886,9 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) /* * Reset layer specific mbuf flags to avoid confusing upper layers. - * Strip off Ethernet header. */ m->m_flags &= ~M_VLANTAG; m_clrprotoflags(m); - m_adj(m, ETHER_HDR_LEN); /* * Dispatch frame to upper layer. @@ -918,6 +916,10 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) default: goto discard; } + + /* Strip off Ethernet header. */ + m_adj(m, ETHER_HDR_LEN); + netisr_dispatch(isr, m); return; @@ -930,11 +932,6 @@ discard: if (ifp->if_l2com != NULL) { KASSERT(ng_ether_input_orphan_p != NULL, ("ng_ether_input_orphan_p is NULL")); - /* - * Put back the ethernet header so netgraph has a - * consistent view of inbound packets. - */ - M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); (*ng_ether_input_orphan_p)(ifp, m); return; }