summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/devices/wifi/nm-device-wifi.c19
-rw-r--r--src/devices/wifi/nm-wifi-ap.c3
2 files changed, 17 insertions, 5 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 90bb2578a4..3fce1a422f 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -1644,11 +1644,20 @@ supplicant_iface_bss_removed_cb (NMSupplicantInterface *iface,
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
ap = get_ap_by_supplicant_path (self, object_path);
- if (ap && ap != priv->current_ap) {
- nm_ap_dump (ap, "removed ", nm_device_get_iface (NM_DEVICE (self)));
- emit_ap_added_removed (self, ACCESS_POINT_REMOVED, ap, TRUE);
- g_hash_table_remove (priv->aps, nm_ap_get_dbus_path (ap));
- schedule_ap_list_dump (self);
+ if (ap) {
+ if (ap == priv->current_ap) {
+ /* The current AP cannot be removed (to prevent NM indicating that
+ * it is connected, but to nothing), but it must be removed later
+ * when the current AP is changed or cleared. Set 'fake' to
+ * indicate that this AP is now unknown to the supplicant.
+ */
+ nm_ap_set_fake (ap, TRUE);
+ } else {
+ nm_ap_dump (ap, "removed ", nm_device_get_iface (NM_DEVICE (self)));
+ emit_ap_added_removed (self, ACCESS_POINT_REMOVED, ap, TRUE);
+ g_hash_table_remove (priv->aps, nm_ap_get_dbus_path (ap));
+ schedule_ap_list_dump (self);
+ }
}
}
diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c
index e1f7bf1a66..68f0ee637f 100644
--- a/src/devices/wifi/nm-wifi-ap.c
+++ b/src/devices/wifi/nm-wifi-ap.c
@@ -387,6 +387,7 @@ nm_ap_update_from_properties (NMAccessPoint *ap,
const char *supplicant_path,
GVariant *properties)
{
+ NMAccessPointPrivate *priv;
const guint8 *bytes;
GVariant *v;
gsize len;
@@ -397,6 +398,7 @@ nm_ap_update_from_properties (NMAccessPoint *ap,
g_return_if_fail (ap != NULL);
g_return_if_fail (properties != NULL);
+ priv = NM_AP_GET_PRIVATE (ap);
g_object_freeze_notify (G_OBJECT (ap));
@@ -475,6 +477,7 @@ nm_ap_update_from_properties (NMAccessPoint *ap,
nm_ap_set_supplicant_path (ap, supplicant_path);
nm_ap_set_last_seen (ap, nm_utils_get_monotonic_timestamp_s ());
+ priv->fake = FALSE;
g_object_thaw_notify (G_OBJECT (ap));
}