From nobody Thu Feb 20 18:05:26 2025 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 4YzLlX2sN3z5pDtF; Thu, 20 Feb 2025 18:05:28 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzLlV6byYz3HZK; Thu, 20 Feb 2025 18:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740074727; 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=Br7vSuk943vT7YJsAoJZBYevvrW4JCl3cqULAPeK7H8=; b=DVQh0GNrYXjuDPGM1xLSkQjepSkd7+uxKGZXpFgRb1LHqaT99jYZ6cZJbQ8kzpEAQ0KIg+ Kv2os7ps53C8+ITDFNmaEHBgBukpfbtB8u4SNQHGjX9rPxwyZnNV4F4Qg8XJbEFwfIb/io nPonQJbaZ3x6bGZrU8dLltPuT9dQjKiJLmNCg4pBT27US+czXOBdBSVMMqW1uYewmqysC4 m3DsCfmiy2kD5Vlx4y49k0HlU5uPZ/jK1g3ymapxNlNemOeimhuUR8cHUbr49XOtB0mFlU 4MO3pTy3GlWEQf1aK5BQhycq5uVkmAYRQIK0TKM5UI3KiptXek0fgHBBUfNHmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740074727; a=rsa-sha256; cv=none; b=Ts30n+3iUswTz53TXh3LXehgJwaLW1Jb1zD1WQM2vPwMSx28lf3eh5LnwShkWIHf2MYWXE u+TDRJyYkqhiC3TwjQTPJao4dD5aaLUOzvfDReSerSPnoWsu2nYNICNtbfElCUgMRCpmNh /ccJvHPkYI2fm8HJxT3zHgQlMVkLG7EZdfagxLNq/n3S18ZW+H6rFlQhpwUYESL5U6xtHQ 2K+TcyDvJ5NA3+KI9DBmwypjQ9zwQH74XIkj7hCEn8VW4qMpkMokwf6rfVOzv7vJd8nSxg ZfY+U+8AUYxxOJ+0B67Phze2hEZRZEmPUwWQHf5MffKyFzPyWXmjphsaoPKGcQ== 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=1740074727; 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=Br7vSuk943vT7YJsAoJZBYevvrW4JCl3cqULAPeK7H8=; b=N5+fsscYxkE9uEDwxBh080AxNeklTty76gaJdNMWX3/yfxJPRh7/CZmnC02Y3/Q2V80waa ySeDYrbOAiLu+vk6ffidw0fwqgu06hXOtaEoAC/V+UsyojXje7KZ/Os8Iwd+3CwblXiRxW C53eNq0aEO0PTgErBsEVQkQR7BdwE0Wy5vUgUXb6Sy7law1AQCuLFlDWYS/JQUwfwPH2cj 3yVYCri/IfbxKoLdy/DmdtJeYoMtB2YRVdW9dmUbrIWdR3m5w5RiW+eTLqtJl+0JmjbQ4a m/EKD3zWuDF7wLSHu+1l4tODZJOgKTMR9wAjMEnxmJ1qzawCwAjX9esDQaLzog== 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 4YzLlV5FWxz134J; Thu, 20 Feb 2025 18:05:26 +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 51KI5QNq088068; Thu, 20 Feb 2025 18:05:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KI5Q5j088065; Thu, 20 Feb 2025 18:05:26 GMT (envelope-from git) Date: Thu, 20 Feb 2025 18:05:26 GMT Message-Id: <202502201805.51KI5Q5j088065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8dcdffdb0861 - main - net80211: crypto: ccmp: simplify and style(9) 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 Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 8dcdffdb086103e9ce36bfa82fc1179c88ebc31b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8dcdffdb086103e9ce36bfa82fc1179c88ebc31b commit 8dcdffdb086103e9ce36bfa82fc1179c88ebc31b Author: Bjoern A. Zeeb AuthorDate: 2025-01-27 13:54:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-20 18:05:00 +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 MFC after: 3 days Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D49055 --- 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