Comment 9 for bug 1181964

Revision history for this message
Bernd Edlinger (bernd-edlinger) wrote :

OK, when you look at nm-device-wifi.c I think I see what is wrong:

When the AP is almost always sending its beacons, but reboots quickly at some point in time, it can be
deleted by cull_scan_list() if it is scheduled exactly at the second because it is not the active AP, and the list entry
was not changed for 3*SCAN_INTERVAL_MAX, and the property WPAS_REMOVED_TAG is set.
some underlying supplicant process does only send bss_removed or new_bss message when the live list is changed
from its perspective.

However, when the AP is once not in the live list when scanned, it may not be guaranteed that the connection really
breaks, but the flag WPAS_REMOVED_TAG is set now and will not be reset when the new_bss is later received the and
the AP data are updated, but the WPAS_REMOVED_TAG should be cleared again. So when that flag is set, cull_scan_list()
can remove the AP at any time, even if the connection would be restored very quickly.
this should be fixed by adding the following line to merge_scanned_ap() when the ap data is updated:

g_object_set_data (G_OBJECT (ap), WPAS_REMOVED_TAG, NULL);

And probably the function supplicant_iface_bss_removed_cb() should set the last-seen property to now.
You should add the following statemeents there to prevent the AP to be removed immediately,
if the signal strength did not change recently.:

g_get_current_time (&now);
nm_ap_set_last_seen (ap, now.tv_sec);