From nobody Mon Apr 15 04:03:37 2024 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 4VHtnk1crwz5HgPS; Mon, 15 Apr 2024 04:03:38 +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 4VHtnk15F2z4TNQ; Mon, 15 Apr 2024 04:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713153818; 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=J5Gi5o8X4JUP9vHHD7ISZxYT8pvN7Ky5giwMmgPp3LY=; b=SFCG8I/FlXYB96slQO61jdVvCUvLpz12NTgMefrDybea5B8vD2FCEu6ko1OY+DB392bu99 Gy7bT9J8htTDV8n+Bnild8c731CXFXpdAP+FjklIhAQgIFE4c7lbhBjNU6LO3sUSg73Qjk NeKr8dzWjwPAQ8pUq/TyWOqhN6w3JnYZHJrgOR8vcfNSnlbRmpCCZ5nMnpfZ93R24n6ugy yemdbmP+vd8lNorrnNZN2qjqSyIXodsUKytOf690MaWPLcPCF4+rlBCyJoOmWHWVVWZiP3 cuifHWu76q3ZcOMrmi3+cA1Z9Boyk71YAzJP4D2sR/Kz+jMlKedc2gzdnLNdJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713153818; a=rsa-sha256; cv=none; b=Ty/iOW8IfCkwyFH5Q74E3lkfYRwLvDyZ6J6HMREIV41inqnSC/qQY2OzCPkow+TPG2ZRoX DPcz3D6tdawpJ/Nm5SPTztWDn0XhCbvU2uje373IE86NMR4il2GTt4UiWHQqEA2omgPu53 ewU1Ob1c0Tw9d0SwsBBmqMu9rw/BT7Tjkg84Hcb7VPBpZtrR8dBLW1qZuDvWsEjkdbDQG1 GSIZsolSbrrdgKUAwf9gB5efNLwD2hf4u0H10dk/O+UMg1+t6aiO8ZwwtJMy++WU6E6LTl 9j8PLqoCJ88elZKk/oVTrHmAOOBtMqQdCtZH8CZKCd9Zh3Ol6BzSY7J21rUqeA== 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=1713153818; 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=J5Gi5o8X4JUP9vHHD7ISZxYT8pvN7Ky5giwMmgPp3LY=; b=SIeGn77QuxLU9NnfDkUO6fDwDtv+d6bzG1FmSTs7Ag3hwmGkmvlc2THkMXNWFXFFVpYnv3 1HPK0/xB5U1PRUAkwxKQOrbL1xRfZ9EhmfO+8RoC0QmS0KMcdPjvaWSyZcqrZwltHaGpat k+fvOTce2Mhg3w1SdUpt266zD3HdYhp1PxLQU32N57Mls6mzYELOA+59WGHDFQUFB9FEy+ r2hakvHTzNDjPHKmDKt7i0HWCVFeKVcbiIbqUibeSpcTz7zszTnsXy65BsaBvXG+0qLlyF pnP3ljhiD7Yvw4pTybbUGa5XXXXCQVvs4rustJD0NksU2KSgeOm5gfkygevy0g== 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 4VHtnk0h0lzlKx; Mon, 15 Apr 2024 04:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43F43bbr051828; Mon, 15 Apr 2024 04:03:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43F43bp3051825; Mon, 15 Apr 2024 04:03:37 GMT (envelope-from git) Date: Mon, 15 Apr 2024 04:03:37 GMT Message-Id: <202404150403.43F43bp3051825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 65212656f845 - stable/13 - ethernet: Fix logging of frame length 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: 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 65212656f845088417881219b5bd0f6355dd50fe Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=65212656f845088417881219b5bd0f6355dd50fe commit 65212656f845088417881219b5bd0f6355dd50fe Author: Zhenlei Huang AuthorDate: 2024-04-08 16:44:33 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-15 04:02:57 +0000 ethernet: Fix logging of frame length Both the mbuf length and the total packet length are signed. While here, update a stall comment to reflect the current practice. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42390 (cherry picked from commit e7102929bf4fea4bf22855d2d6031edf6c413608) (cherry picked from commit 4d65728d55a754f2529ca2cfb87c9588146563d0) --- sys/net/if_ethersubr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index b361af2fe428..c0b2b4f3f448 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -529,10 +529,10 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m) return; } #endif - if (m->m_len < ETHER_HDR_LEN) { - /* XXX maybe should pullup? */ + if (__predict_false(m->m_len < ETHER_HDR_LEN)) { + /* Drivers should pullup and ensure the mbuf is valid */ if_printf(ifp, "discard frame w/o leading ethernet " - "header (len %u pkt len %u)\n", + "header (len %d pkt len %d)\n", m->m_len, m->m_pkthdr.len); if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m);