mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 13:08:10 +02:00
device/wifi: don't reset the SSID of a NMWifiAP to unknown
For hidden networks, we usually don't have an SSID. We try to match and fill the SSID based on the profiles that we have: <debug> [1603798852.9918] device[6b383dca267b6878] (wlp2s0): matched hidden AP AA:BB:CC:DD:EE:FF => "SSID" However, we should not clear that value again on the next update: <trace> [1603798856.5724] sup-iface[66c1a0883a262394,0,wlp2s0]: BSS /fi/w1/wpa_supplicant1/Interfaces/0/BSSs/3 updated <debug> [1603798856.5726] device[6b383dca267b6878] (wlp2s0): wifi-ap: updated AA:BB:CC:DD:EE:FF (none) Once we have a SSID, we can only update it to a better value, but not clear it. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/438 Fixes:b83f07916a('supplicant: large rework of wpa_supplicant handling') (cherry picked from commiteb36380335) (cherry picked from commit40edd49025)
This commit is contained in:
parent
836512351d
commit
42d28ae2e8
1 changed files with 11 additions and 9 deletions
|
|
@ -115,24 +115,26 @@ nm_wifi_ap_set_ssid (NMWifiAP *ap, GBytes *ssid)
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_WIFI_AP (ap), FALSE);
|
g_return_val_if_fail (NM_IS_WIFI_AP (ap), FALSE);
|
||||||
|
|
||||||
if (ssid) {
|
if (!ssid) {
|
||||||
l = g_bytes_get_size (ssid);
|
/* we don't clear the SSID, once we have it. We can only update
|
||||||
if (l == 0 || l > 32)
|
* it by a better value. */
|
||||||
g_return_val_if_reached (FALSE);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l = g_bytes_get_size (ssid);
|
||||||
|
if (l == 0 || l > 32)
|
||||||
|
g_return_val_if_reached (FALSE);
|
||||||
|
|
||||||
priv = NM_WIFI_AP_GET_PRIVATE (ap);
|
priv = NM_WIFI_AP_GET_PRIVATE (ap);
|
||||||
|
|
||||||
if (ssid == priv->ssid)
|
if (ssid == priv->ssid)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if ( ssid
|
if (priv->ssid && g_bytes_equal (ssid, priv->ssid))
|
||||||
&& priv->ssid
|
|
||||||
&& g_bytes_equal (ssid, priv->ssid))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
g_bytes_ref (ssid);
|
||||||
nm_clear_pointer (&priv->ssid, g_bytes_unref);
|
nm_clear_pointer (&priv->ssid, g_bytes_unref);
|
||||||
if (ssid)
|
priv->ssid = ssid;
|
||||||
priv->ssid = g_bytes_ref (ssid);
|
|
||||||
|
|
||||||
_notify (ap, PROP_SSID);
|
_notify (ap, PROP_SSID);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue