diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h index cc01b0044..1a603f687 100644 --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h @@ -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 */ diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 72a736833..d67365f89 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -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,