diff options
author | Jaehyun Kim <jeik01.kim@samsung.com> | 2023-09-07 16:37:12 +0900 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2023-09-07 20:56:48 +0900 |
commit | ebd4bbe31aa8319759b8b39992a627329db4e30e (patch) | |
tree | 74ef6e5831572485d441eee0213f3b95536d5f6e | |
parent | f1d92a10ada80d2bc3aed2c9f396c8a169535ee0 (diff) | |
download | connman-ebd4bbe31aa8319759b8b39992a627329db4e30e.tar.gz connman-ebd4bbe31aa8319759b8b39992a627329db4e30e.tar.bz2 connman-ebd4bbe31aa8319759b8b39992a627329db4e30e.zip |
Update ssid frequency only from best bss signal
Only changes to the best bssid update the frequency of the ssid network info.
If not, the bssid and frequency of the actual connection target may not match.
Change-Id: Ic02dc87526b2526eaf340f00fdbb1cbe0f31c172
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rwxr-xr-x | gsupplicant/supplicant.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index fce4f7b3..c144a4f1 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -2657,6 +2657,7 @@ static void update_network_with_best_bss(GSupplicantNetwork *network, network->signal = best_bss->signal; network->frequency = best_bss->frequency; + network->phy_mode = best_bss->phy_mode; network->best_bss = best_bss; } @@ -3530,6 +3531,8 @@ static void update_signal(gpointer key, gpointer value, if (!network->best_bss || (network->best_bss == bss)) { if (bss->signal > network->signal) { network->signal = bss->signal; + network->frequency = bss->frequency; + network->phy_mode = bss->phy_mode; network->best_bss = bss; } return; @@ -3615,10 +3618,10 @@ static void interface_current_bss(GSupplicantInterface *interface, struct g_supplicant_bss *bss; const char *path; #if defined TIZEN_EXT - char bssid_buff1[WIFI_BSSID_STR_LEN] = {0,}; - char bssid_buff2[WIFI_BSSID_STR_LEN] = {0,}; - char *bssid_str1 = bssid_buff1; - char *bssid_str2 = bssid_buff2; + char curr_bssid_buff[WIFI_BSSID_STR_LEN] = {0,}; + char best_bssid_buff[WIFI_BSSID_STR_LEN] = {0,}; + char *curr_bssid_str = curr_bssid_buff; + char *best_bssid_str = best_bssid_buff; gboolean update = FALSE; #endif @@ -3640,14 +3643,15 @@ static void interface_current_bss(GSupplicantInterface *interface, interface->current_network = network; #if defined TIZEN_EXT - snprintf(bssid_str1, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(bss->bssid)); - snprintf(bssid_str2, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(network->best_bss->bssid)); + snprintf(curr_bssid_str, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(bss->bssid)); + snprintf(best_bssid_str, WIFI_BSSID_STR_LEN, MACSTR, MAC2STR(network->best_bss->bssid)); SUPPLICANT_DBG("current network [%p], Passed bss %s, best bss %s", - interface->current_network, bssid_str1, bssid_str2); + interface->current_network, curr_bssid_str, best_bssid_str); if (network->frequency != bss->frequency) { network->frequency = bss->frequency; + network->phy_mode = bss->phy_mode; update = TRUE; } #endif @@ -4445,7 +4449,8 @@ static void signal_bss_changed(const char *path, DBusMessageIter *iter) supplicant_dbus_property_foreach(iter, bss_property, bss); #if defined TIZEN_EXT - if (network->interface->state != G_SUPPLICANT_STATE_COMPLETED) { + if (network->interface->state != G_SUPPLICANT_STATE_COMPLETED && + bss == network->best_bss) { network->frequency = bss->frequency; network->phy_mode = bss->phy_mode; } |