]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: mac80211: Use struct instead of macro for PREP frame
authorMasashi Honma <masashi.honma@gmail.com>
Fri, 29 May 2026 23:09:44 +0000 (08:09 +0900)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jun 2026 12:07:06 +0000 (14:07 +0200)
commita91c65cb99d1e03c8d8f0244258cbdd2d60faa86
tree91af37391172bab19e316ff924df2a48c7b92aab
parent4ac20bd40b7db8568aea5ba1d390241842e41ed8
wifi: mac80211: Use struct instead of macro for PREP frame

The existing PREP_IE_* macros access HWMP PREP frame fields via hardcoded
byte offsets. When the AE (Address Extension) flag is set, an additional
6 bytes appear mid-frame, making the offset arithmetic error-prone.

Introduce typed packed C structs to represent the PREP frame layout:
  - ieee80211_mesh_hwmp_prep_top: fixed fields before the optional AE
    address
  - ieee80211_mesh_hwmp_prep_bottom: fields after the optional AE address

Add ieee80211_mesh_hwmp_prep_get_bottom() to locate the bottom struct
correctly based on whether the AE flag is set.

This preparatory refactoring is needed to fix a 2-byte overread of
orig_addr in hwmp_prep_frame_process() when AE is enabled, which is
addressed in a subsequent patch.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Link: https://patch.msgid.link/20260529230952.124754-2-masashi.honma@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/ieee80211-mesh.h
net/mac80211/mesh_hwmp.c