From nobody Mon Feb 24 20:27:23 2025 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 4Z1sjW1Cgqz5pq6S; Mon, 24 Feb 2025 20:27:27 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1sjS1VSHz3p0w; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740428844; 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=e/3zdNWwUI8nWeMH035gduZc/Al/N1z73utxMFmpfPY=; b=TzlyLonBL0afI7dlCEK+tfGzs7MSQzFx/OLUGdyrHhN7LgMvIhxCx9RzU28TAagc1vBOzI R2CovYFYmbNSc57+5lajEZOSLWqP3sPAxqvsZlDxmbi51tE8zp7lckdjbX23nmVKjibYar z71/BiYMZp25hamazIAXmLxIh7GGkThbnVB51RbPjIHIir8eBFpr9FtARinpAsjz015DMe WPh5nuCQjsLbF1QQ/WE+oHu3Kfe+KIWgHrdfpjjyGPhzlWvFchalqR2GmzYo5DovRjgeZc 5AUXN5bQkhcuMa1O9orKOttP/vGSj0h62c/FRHWvb/prN8L35IUbcBlA+zYMRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740428844; a=rsa-sha256; cv=none; b=eqDedOQBbprEExOFA86P791PhYNSPr48xssHlFUrTF2f3zbH0fTvg1jfm/9lxQt7wS96/a oQwgb2VLmym/Lg2RF7eoDZpUVJwWdW4DO8g8DkWG0f8DTiL5gk75ZCwUXNRu90NPk/eZ+K nmXc+XRFaSiK2f5EB7xK0RiqHPFGErv08kUph7ASinEZhXfxIQlIUw2tdXsRkNWNqNUeAV xmJVtAQuoC7SrZlbcdsg0B9+WGI2gNPNQrow1GgKS6HIqk5/D5o13Ex1dwjKhZNxko/vO4 EnLB2xiaNc175xQOpu72OVMY+oXMUT9wz1dhHdxMn3QPVLH02NF8Iq4WgNEACw== 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=1740428844; 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=e/3zdNWwUI8nWeMH035gduZc/Al/N1z73utxMFmpfPY=; b=YYYcV3W4Jdh5IG87q9drho5njdWV3oiApl52Z9sofzyf4I4bePMPwybB1dFpR8nuNRJfbF Tgd6URCOTWwG0NYDTh2su/UjNYTtVgGqi44vl7NytaQ/Z5ewSaf4aw8dhDtR1eUigJSt/d rKFzB5+BabAW17tvOLnzn93q93tVrOZMm5cVzJ+6bFerCJIiXYOs/f5htMNA+FecG4g1Cu 5tdUl3dccq81Z/QRlirCxvUi7sJUWdKHocY6SoFf1J4M3LHFpIG+d2WQFNEhBYgZTnPW1z 5RAqfOfDoe49ZY2I4EAmyezvVrHL9/wB7/Vy0KInrhmiBG8lDNXGKOn4WTG7ig== 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 4Z1sjR28WWzwYQ; Mon, 24 Feb 2025 20:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51OKRNGT027677; Mon, 24 Feb 2025 20:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51OKRNdc027674; Mon, 24 Feb 2025 20:27:23 GMT (envelope-from git) Date: Mon, 24 Feb 2025 20:27:23 GMT Message-Id: <202502242027.51OKRNdc027674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8feaeb95440b - stable/14 - net80211: crypto: ccmp: simplify and style(9) 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8feaeb95440b851202d59f12d7bde0500109be5b Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8feaeb95440b851202d59f12d7bde0500109be5b commit 8feaeb95440b851202d59f12d7bde0500109be5b Author: Bjoern A. Zeeb AuthorDate: 2025-01-27 13:54:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-24 20:26:50 +0000 net80211: crypto: ccmp: simplify and style(9) Comply with style(9) and andd checks for booleaness when doing bit tests. If there is no need for double negated checks simplify them. This all makes the conditions a lot easier to read. Slip in a comment about MIC vs. MMIC. No functional changes. Sponsored by: The FreeBSD Foundation Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D49055 (cherry picked from commit 8dcdffdb086103e9ce36bfa82fc1179c88ebc31b) --- sys/net80211/ieee80211_crypto_ccmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 06028cf2a37c..404996b1cbca 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -242,7 +242,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) rxs = ieee80211_get_rx_params_ptr(m); - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP)) + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) != 0) goto finish; /* @@ -297,14 +297,15 @@ finish: /* * XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer. + * Well no as it's a MIC not MMIC but we re-use the same flag for now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP))) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) == 0) m_adj(m, -ccmp.ic_trailer); /* * Ok to update rsc now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) == 0) { /* * Do not go backwards in the IEEE80211_KEY_NOREPLAY cases * or in case hardware has checked but frames are arriving