From nobody Mon Apr 08 16:46:01 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 4VCw2f5fC6z5HL5H; Mon, 8 Apr 2024 16:46:02 +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 4VCw2f4s5xz4MfZ; Mon, 8 Apr 2024 16:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712594762; 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=50G16SaSwutG4tCG12hVyc1NJD6uQRDjSJYSDRTczrI=; b=ZrnESfhibMNwR6v6A0UKcKEHe+Ird17G29lDs6Sz+NWvmgivMBqEXj6xeQhU8OegE5QWrh 5MhKV9LObYVUJGsu1Ckd/0q+UFoumTciQVNO5dpIeXE5HR6xuc8uK1F4YPMC9K0j2WkT4S jN5hVAd9jAxa3uncFFRV8jsTCcD50yRCCJWb/NTP1yi1vm8khtWfN2C0QGIHM3NcyLSB+K Esl4p3DixZJ3n5cBnmf81awqASaR9CwEmd+76Tjr4m96QtBek7FcSJDQSUJsXaFwfCG1mA 4QQWkUREPGzWDTPHzEllXIbPzTrxEibx/xOXLrsmGuYcZ9Vge5CwwEUNCWfW8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712594762; a=rsa-sha256; cv=none; b=uouRaj/QtGRn5BCfC4/Mi1XnBSJovbexnIm+QLnEt3MFFxk6N0aX5rm2yGXcWQ77ZGUH7W kGxoQ44sRS2hq6bw+fWocG8iwSwAI4kp5VKytnXIW5/wVBdymxCB01JDWO55UO+TxcSDaA MU5UO7/sRtgdpS47E1xd2VUJXA+SNnL0oXl7H5ep2tOqX+D4LNKgYsoIf18EDaiDjauQhk EIFY9LYtygbaxYeckgmS26qvocygClkSj8ufDX+0g74JlNWoyWnzLDqx8e8jtNNI2srIkM A4hG26/LkrhPcG93rTYDdKP1hx3Yi3SFrjaYxt3VO5TrbFPShEHj9PZuBO+h+g== 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=1712594762; 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=50G16SaSwutG4tCG12hVyc1NJD6uQRDjSJYSDRTczrI=; b=J+FEYTdx+Vv9B3RKVYd6UvIwZbt6EFVg4mY+Tac5VUBZ+7mIqrdWEgn3ODW+KGgGm0C049 IxdcyPypx+AsGRL8L8g/G2EtY3IJ60oNAEmLHURd2H91j9IaV+UZo6T1iT7nqB8evHAF/V T+FpMYp4QrtYsYy8R4ONDzxr1h9Lzt1d7BYzKM11FlgcbhESIodN1f7Zg+VrncBKc9+/nv AShTwJT3FdNpgTQLK6tUWsSoT4n7o1WflkjooE1zn9GO5TziL2MEdjPKHMBPvwwiNHq/YI +52XaWZIpOaxwHNnVH55QE2eLDth2zRkM5STFmbmd5uL7T8PQbA8UitW1F5nhA== 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 4VCw2f4Lh1zJJn; Mon, 8 Apr 2024 16:46:02 +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 438Gk1Bu055935; Mon, 8 Apr 2024 16:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438Gk1YR055932; Mon, 8 Apr 2024 16:46:01 GMT (envelope-from git) Date: Mon, 8 Apr 2024 16:46:01 GMT Message-Id: <202404081646.438Gk1YR055932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: e7102929bf4f - main - 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: 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7102929bf4fea4bf22855d2d6031edf6c413608 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e7102929bf4fea4bf22855d2d6031edf6c413608 commit e7102929bf4fea4bf22855d2d6031edf6c413608 Author: Zhenlei Huang AuthorDate: 2024-04-08 16:44:33 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-08 16:44:33 +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 --- 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 4332f4ce864e..eeb2c1ea4ef3 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -534,10 +534,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);