diff options
author | Jaehyun Kim <jeik01.kim@samsung.com> | 2020-12-23 20:19:37 +0900 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2020-12-23 20:19:37 +0900 |
commit | 4b35ef68761853c967806474c84216ba2a3c006c (patch) | |
tree | f62e557bbdb31448ad25196eabbff1e341cf564f /plugins | |
parent | b3d6037c3a19870964c3ab3c921c5e9398a1a537 (diff) | |
download | connman-4b35ef68761853c967806474c84216ba2a3c006c.tar.gz connman-4b35ef68761853c967806474c84216ba2a3c006c.tar.bz2 connman-4b35ef68761853c967806474c84216ba2a3c006c.zip |
Remove useless network path of the wifi interface when removing networksubmit/tizen_6.0/20210105.073751accepted/tizen/6.0/unified/20210107.080326
When removing a network, if the network path of the interface is not NULL
and has the same information as the network to be removed, it need to be removed.
Otherwise, when a connection to the same network is attempted later,
the connection may not work normally.
Change-Id: I788189a1b2e3ac00c5c9e9804d8543ec44ee705b
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/wifi.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index 6672f0dd..e44d16ed 100755 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -219,6 +219,8 @@ struct enc_method_call_data { static struct enc_method_call_data encrypt_request_data; +static GSupplicantSecurity network_security(const char *security); + static void encryption_request_reply(DBusPendingCall *call, void *user_data) { @@ -3365,6 +3367,11 @@ static void network_remove(struct connman_network *network) { struct connman_device *device = connman_network_get_device(network); struct wifi_data *wifi; +#if defined TIZEN_EXT + GSupplicantSSID *ssid; + const void *ssid_data; + const char *security; +#endif DBG("network %p", network); @@ -3385,6 +3392,34 @@ static void network_remove(struct connman_network *network) if (wifi->scan_pending_network == network) wifi->scan_pending_network = NULL; + + /* + * If this remove network is for the same network + * for which wpa_supplicant already has a profile + * then need to remove that profile. + */ + ssid = g_try_malloc0(sizeof(GSupplicantSSID)); + if (!ssid) + return; + + ssid_data = connman_network_get_blob(network, "WiFi.SSID", + &ssid->ssid_len); + ssid->ssid = g_try_malloc0(ssid->ssid_len); + + if (!ssid->ssid) { + g_free(ssid); + return; + } else { + memcpy(ssid->ssid, ssid_data, ssid->ssid_len); + } + + security = connman_network_get_string(network, "WiFi.Security"); + ssid->security = network_security(security); + + g_supplicant_interface_remove_network(wifi->interface, ssid); + + g_free(ssid->ssid); + g_free(ssid); #endif } |