Check the wpa_flags and rsn_flags values to see if the network needs the password added to the 802-11-wireless-security settings. The current ap_flags check alone would only trigger the password to be sent for WEP networks. Also remove unneeded initialization of the three variables.
140ada3aa cli: Actually add passwords to the AddAndActivateConnection arguments
clients/cli/devices.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)