wifi: ieee80211: reorder presence checks in MLE per-STA profile
authorJohannes Berg <johannes.berg@intel.com>
Sun, 18 Jun 2023 18:49:56 +0000 (21:49 +0300)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 16 Sep 2023 21:53:58 +0000 (23:53 +0200)
In ieee80211_mle_sta_prof_size_ok(), the presence
checks aren't ordered by field order, so that's a
bit confusing. Reorder them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230618214436.fdbf17320a37.I517cf27fdc3f6e5d6a2615182da47ba4bdf14039@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
include/linux/ieee80211.h

index c27cb7ec229a31a17b00bad3d42d722ee6b4010e..273d25f2d021342ad98f6b7126c01f5f9bf9a939 100644 (file)
@@ -4804,9 +4804,6 @@ static inline bool ieee80211_mle_basic_sta_prof_size_ok(const u8 *data,
                info_len += 8;
        if (control & IEEE80211_MLE_STA_CONTROL_DTIM_INFO_PRESENT)
                info_len += 2;
-       if (control & IEEE80211_MLE_STA_CONTROL_BSS_PARAM_CHANGE_CNT_PRESENT)
-               info_len += 1;
-
        if (control & IEEE80211_MLE_STA_CONTROL_COMPLETE_PROFILE &&
            control & IEEE80211_MLE_STA_CONTROL_NSTR_BITMAP_SIZE) {
                if (control & IEEE80211_MLE_STA_CONTROL_NSTR_BITMAP_SIZE)
@@ -4814,6 +4811,8 @@ static inline bool ieee80211_mle_basic_sta_prof_size_ok(const u8 *data,
                else
                        info_len += 1;
        }
+       if (control & IEEE80211_MLE_STA_CONTROL_BSS_PARAM_CHANGE_CNT_PRESENT)
+               info_len += 1;
 
        return prof->sta_info_len >= info_len &&
               fixed + prof->sta_info_len <= len;