mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 02:20:06 +01:00
nmcli: fix "device wifi connect" command with existing connection
Executing this command twice, or when a connection profile already
exists for the SSID:
nmcli device wifi connect $SSID password $PASSWORD
returns error:
Error: 802-11-wireless-security.key-mgmt: property is missing.
When setting the password nmcli was wiping the existing wireless
security setting.
Fixes: c8ff1b30fb ('nmcli/dev: use secret agent for nmcli d [wifi] connect')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1688
This commit is contained in:
parent
8e0825f9cd
commit
3a4e18e302
1 changed files with 1 additions and 0 deletions
|
|
@ -4041,6 +4041,7 @@ do_device_wifi_connect(const NMCCommand *cmd, NmCli *nmc, int argc, const char *
|
|||
if (password) {
|
||||
if (!connection)
|
||||
connection = nm_simple_connection_new();
|
||||
s_wsec = nm_connection_get_setting_wireless_security(connection);
|
||||
if (!s_wsec) {
|
||||
s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new();
|
||||
nm_connection_add_setting(connection, NM_SETTING(s_wsec));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue