device_start() would unconditionally transition the device to UNAVAILABLE
no matter what the initial managed setting was. There was a short window
for a race with HAL where device_start() wouldn't get canceled if HAL
was starting up in parallel with NetworkManager.
So that normal users who have PolicyKit authorization to edit system connections
can read secrets, move system connection secrets logic into the system connection
service from libnm-glib, and protect it with PolicyKit checks. Convert the
ifcfg-rh plugin over to using NMSysconfigConnection so that it can take advantage
of the new PolicyKit protection.
Fix issues with crappy wifi drivers which send a stream of associate
events before NM can schedule the next activation stage, which actually
scheduled *multiple* next stages. Only allow one stage to be scheduled at
at time, and don't schedule the same stage again if it's already next up
to the plate.
Fake APs created in nm_ap_new_fake_from_connection() didn't get the
right flags due to wrong interpretation of # WPA protos; no protos really
means "all ciphers". Thus the applet wouldn't ask for the right type of
security info if the connection failed; for hidden WPA networks, the applet
would instead ask for WEP keys.
Clean up addition of flags for 'fake' WPA APs in general; pairwise
shouldn't ever include WEP ciphers, and if the connection didn't
include any pairwise or group ciphers, default to "all" as is
expected. Also fix flags for WPA Ad-Hoc networks, since they have
special limitations imposed by the supplicant and drivers.
The first fix didn't cover creating a new adhoc network while already joined
to an existing adhoc network; thus clearing the 'fake' flag wouldn't necessarily
drop the old adhoc network from the scan list, because NM doesn't scan in adhoc
mode, and thus the scan list culling function wouldn't run.
Even if the AP being removed isn't adhoc, it was never found from a scan anyway
(if it had, the fake flag would have been reset) and thus we don't care about
it anymore.
Since NM doesn't scan while associated with an Ad-Hoc BSS (since
scanning in adhoc mode makes most driver quite angry and doesn't
work well anyway) the user-created BSS was never found in the scan
list, and the 'fake' flag wasn't cleared. Thus the BSS stuck
around in NM's scan list forever.
Additionally, ensure that set_current_ap() maintains a reference
to the old AP until after setting the new AP, just in case the same
AP is being set again.
Third, handle IBSS coalescing by always updating the current AP's
address (if it's an Ad-Hoc AP) with the BSSID reported by the card.
The joined Ad-Hoc networks' BSSID will change if the card
coalesces with other stations in the same IBSS, which would make
NM fail to find the currently joined network in the scan list, and
lead to "roamed to (none)" messages and inability to find the
current AP.