Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2025 09:22:12 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: db8ceb8e5948 - main - net80211: cleanup keyidx argument of ieee80211_notify_michael_failure()
Message-ID:  <202503180922.52I9MCCJ076216@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=db8ceb8e59487d1d6b2e019efab3eef40688731c

commit db8ceb8e59487d1d6b2e019efab3eef40688731c
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-03-14 23:33:26 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-03-18 09:21:47 +0000

    net80211: cleanup keyidx argument of ieee80211_notify_michael_failure()
    
    Instead of passing -1 to the function in ieee80211_crypto_demic(),
    use the defined IEEE80211_KEYIX_NONE.
    net80211 uses ieee80211_keyix not u_int as type for the key index
    internally.  Use that.  This also helps when printing the -1 unsigned
    as it stays within the expected numerical scope and makes the debug
    message more readable.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Reviewed by:    adrian
    Differential Revision: https://reviews.freebsd.org/D49368
---
 sys/net80211/ieee80211_crypto.c  | 3 ++-
 sys/net80211/ieee80211_crypto.h  | 2 +-
 sys/net80211/ieee80211_freebsd.c | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
index daa2e0c1d6ec..b1c8b750e145 100644
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -800,7 +800,8 @@ ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k,
 			 * modules to handle a NULL key and not to dereference
 			 * it.
 			 */
-			ieee80211_notify_michael_failure(vap, wh, -1);
+			ieee80211_notify_michael_failure(vap, wh,
+			    IEEE80211_KEYIX_NONE);
 			return (0);
 		}
 
diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h
index 5a365dd37aa3..a830d89c6dc8 100644
--- a/sys/net80211/ieee80211_crypto.h
+++ b/sys/net80211/ieee80211_crypto.h
@@ -273,6 +273,6 @@ void	ieee80211_notify_replay_failure(struct ieee80211vap *,
 		const struct ieee80211_frame *, const struct ieee80211_key *,
 		uint64_t rsc, int tid);
 void	ieee80211_notify_michael_failure(struct ieee80211vap *,
-		const struct ieee80211_frame *, u_int keyix);
+		const struct ieee80211_frame *, ieee80211_keyix keyix);
 #endif /* defined(__KERNEL__) || defined(_KERNEL) */
 #endif /* _NET80211_IEEE80211_CRYPTO_H_ */
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c
index db118bc19d16..d3c8352ab411 100644
--- a/sys/net80211/ieee80211_freebsd.c
+++ b/sys/net80211/ieee80211_freebsd.c
@@ -870,7 +870,7 @@ ieee80211_notify_replay_failure(struct ieee80211vap *vap,
 
 void
 ieee80211_notify_michael_failure(struct ieee80211vap *vap,
-	const struct ieee80211_frame *wh, u_int keyix)
+	const struct ieee80211_frame *wh, ieee80211_keyix keyix)
 {
 	struct ifnet *ifp = vap->iv_ifp;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202503180922.52I9MCCJ076216>