Skip to contentSkip to conversation

wifi: cfg80211: change mesh_setup::ie_len to size_t

PATCH New Srinivas Achary 1 participant 1 message Jul 23 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wifi: cfg80211: change mesh_setup::ie_len to size_t

The ie_len field in struct mesh_setup stores the length of the information elements (IEs) buffer. It is currently defined as u8, which limits the maximum supported length to 255 bytes.

The IE length is derived from memory buffers whose size is naturally represented by size_t. Using u8 may truncate larger values and can result in incorrect length handling.

Change ie_len to size_t so it can represent the full buffer length and match the type commonly used for memory sizes throughout the kernel.

---
Changes in v2:
- Add the "wifi: cfg80211:" subsystem prefix.
- Replace the non-standard Co-authored-by trailer with Signed-off-by.

 include/net/cfg80211.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/cfg80211.h +1 -1
index f5abf1db7558..c9af5abdec1f 100644
@@ -2803,7 +2803,7 @@ struct mesh_setup {
 	u8 path_metric;
 	u8 auth_id;
 	const u8 *ie;
-	u8 ie_len;
+	size_t ie_len;
 	bool is_authenticated;
 	bool is_secure;
 	bool user_mpm;
Signature · 1 line
2.34.1