]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBO: Get rid of the is_first flag in neighbor report array
authorJouni Malinen <j@w1.fi>
Sun, 29 Dec 2024 10:11:25 +0000 (12:11 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Dec 2024 10:37:39 +0000 (12:37 +0200)
This was set to 1 for the entry at position 0 if
wnm_mbo_trans_reason_present is set. The flag was used only under that
condition and the array position is known, so it is simpler to just use
that without an explicit flag indicating which entry is first.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wnm_sta.c
wpa_supplicant/wnm_sta.h

index 610dfd372ca50664d1948131c5902897b1ab63eb..946f8c96baf11a10a6415994c4e816343b4a5c9f 100644 (file)
@@ -669,8 +669,8 @@ fetch_drv_mbo_candidate_info(struct wpa_supplicant *wpa_s,
 
                        nei->drv_mbo_reject = !info->candidates[i].is_accept;
 
-                       /* Use the reject reason from "first" candidate */
-                       if (nei->is_first && nei->drv_mbo_reject)
+                       /* Use the reject reason from the first candidate */
+                       if (i == 0 && nei->drv_mbo_reject)
                                *reason = info->candidates[i].reject_reason;
 
                        break;
@@ -1312,15 +1312,6 @@ static int wnm_parse_candidate_list(struct wpa_supplicant *wpa_s,
                                *num_valid_candidates += 1;
 
                        wpa_s->wnm_num_neighbor_report++;
-#ifdef CONFIG_MBO
-                       if (wpa_s->wnm_mbo_trans_reason_present &&
-                           wpa_s->wnm_num_neighbor_report == 1) {
-                               rep->is_first = 1;
-                               wpa_printf(MSG_DEBUG,
-                                          "WNM: First transition candidate is "
-                                          MACSTR, MAC2STR(rep->bssid));
-                       }
-#endif /* CONFIG_MBO */
                }
 
                pos += len;
index 5994027a448c5380fafa290d7f710450a7b16212..80928f75500cdc3f2429ba8a835858b5eb00ca59 100644 (file)
@@ -45,7 +45,6 @@ struct neighbor_report {
        unsigned int bearing_present:1;
        unsigned int bss_term_present:1;
 #ifdef CONFIG_MBO
-       unsigned int is_first:1;
        unsigned int drv_mbo_reject:1;
 #endif /* CONFIG_MBO */
        struct measurement_pilot *meas_pilot;