Drive Wi-Fi through wpa_cli, save networks only once they connect
Wireless is now handled through wpa_supplicant's control socket
instead of by editing /etc/wpa_supplicant.conf and restarting the
daemon. Scanning, saving, forgetting, connecting and disconnecting all
go through wpa_cli, and the daemon started by rc is the only one that
ever runs. networkmgr never runs the wpa_supplicant binary, never
restarts a service on the Wi-Fi path, and never uses shell=True.
Connecting
- connect_to_ssid() joins the clicked network with select_network, so
with two saved networks in range the one clicked is the one joined.
wait_for_connection() requires wpa_state=COMPLETED and a matching
ssid; ifconfig's "associated" is not used, since it appears before
the key handshake finishes.
- Save on connect. A new network, or a retyped passphrase, lives in the
daemon only until wait_for_connection() succeeds, then save_config
writes the file. A passphrase that never works never reaches disk,
[108 lines not shown]