]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update current BSS level when signal change event occurs
authorMatthieu Mauger <matthieux.mauger@intel.com>
Wed, 18 Feb 2015 02:35:15 +0000 (21:35 -0500)
committerJouni Malinen <j@w1.fi>
Sat, 21 Feb 2015 14:07:53 +0000 (16:07 +0200)
When an EVENT_SIGNAL_CHANGE occurs the bgscan is informed about this
change but the new RSSI value is not stored. In consequence, when
roaming candidates are evaluated, the RSSI value of the current BSS used
to compare is an old one obtained during the last scan rather than the
new one given by the signal change event. This leads sometimes to bad
decision when selecting a new BSS for roaming.

This patch solves the issue by updating the current BSS level when
receiving a signal change event in order to have a very up-to-date
current signal value when choosing an new BSS.

Signed-off-by: Matthieu Mauger <matthieux.mauger@intel.com>
wpa_supplicant/bss.h
wpa_supplicant/events.c

index cc01b0044b6282052b4165c1496a6a47a3338275..1a603f6878fa3a1fd96493bd13292546787a63ea 100644 (file)
@@ -137,4 +137,10 @@ static inline int bss_is_dmg(const struct wpa_bss *bss)
        return bss->freq > 45000;
 }
 
+static inline void wpa_bss_update_level(struct wpa_bss *bss, int new_level)
+{
+       if (bss != NULL && new_level < 0)
+               bss->level = new_level;
+}
+
 #endif /* BSS_H */
index 72a7368333c364e174b6c0f3ad716f0c8614bdd6..d67365f8962a0ef6f634eddc3f41cd598b57015d 100644 (file)
@@ -3431,6 +3431,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                        data->signal_change.current_signal,
                        data->signal_change.current_noise,
                        data->signal_change.current_txrate);
+               wpa_bss_update_level(wpa_s->current_bss,
+                                    data->signal_change.current_signal);
                bgscan_notify_signal_change(
                        wpa_s, data->signal_change.above_threshold,
                        data->signal_change.current_signal,