diff options
author | Dan Williams <dcbw@redhat.com> | 2012-03-02 18:17:34 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-03-02 18:17:34 -0600 |
commit | 5cd9b1e22fcb769eeac85bb16b09d3358ddc44f9 (patch) | |
tree | c4cc4dae72d4cca5940428954fabf7be86f77cf3 /src/supplicant-manager/nm-supplicant-interface.c | |
parent | fb06cda7239cce9449a3af6cecd85fa9063362da (diff) | |
download | NetworkManager-5cd9b1e22fcb769eeac85bb16b09d3358ddc44f9.tar.gz |
wifi: don't remove APs still known to the supplicant
Because the supplicant doesn't have a BSS property for "last seen"
we have to fake that by listening to PropertiesChanged events for
stuff like signal strength, which usually changes a bit from scan
to scan. But in case it doesn't change, we'll never get that PC
signal, and thus we'll never update our internal 'last seen'
timestamp, and thus the AP will get removed from the NM scan list
even if it was in the supplicant's last scan results.
So, if the AP if we haven't receieved a BssRemoved signal for the
AP yet don't remove it from the NM scan list. One caveat is that
if the supplicant's DEFAULT_BSS_EXPIRATION_AGE value is greater
than NM's AP expiration age, NM will by consequence use the
supplicant's value instead. At the moment the supplicant sets
DEFAULT_BSS_EXPIRATION_AGE to 180 seconds while NM's is 360.
Diffstat (limited to 'src/supplicant-manager/nm-supplicant-interface.c')
-rw-r--r-- | src/supplicant-manager/nm-supplicant-interface.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 042ef9ee07..f8ad8f18a9 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -60,6 +60,7 @@ enum { REMOVED, /* interface was removed by the supplicant */ NEW_BSS, /* interface saw a new access point from a scan */ BSS_UPDATED, /* a BSS property changed */ + BSS_REMOVED, /* supplicant removed BSS from its scan list */ SCAN_DONE, /* wifi scan is complete */ CONNECTION_ERROR, /* an error occurred during a connection request */ CREDENTIALS_REQUEST, /* 802.1x identity or password requested */ @@ -356,6 +357,8 @@ wpas_iface_bss_removed (DBusGProxy *proxy, NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + g_signal_emit (self, signals[BSS_REMOVED], 0, object_path); + g_hash_table_remove (priv->bss_proxies, object_path); } @@ -1450,6 +1453,15 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) _nm_marshal_VOID__STRING_POINTER, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER); + signals[BSS_REMOVED] = + g_signal_new (NM_SUPPLICANT_INTERFACE_BSS_REMOVED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, bss_removed), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, G_TYPE_STRING); + signals[SCAN_DONE] = g_signal_new (NM_SUPPLICANT_INTERFACE_SCAN_DONE, G_OBJECT_CLASS_TYPE (object_class), |