NetworkManager/clients
Thomas Haller 53aa340476 nmcli: fix wrongly adding a generic setting when constructing connection
nmc_read_connection_properties() iterates over the input arguments, and
completes the connection.

Initially, the type is not yet known, in that case, we should not wrongly
assume that this is a generic connection. Later, when the type is specified,
con_settings() will return the correct settings.

Previously, this would wrongly add a [generic] section:

  $ nmcli connection add type ethernet ifname eth1 con-name ethie autoconnect no ipv4.method auto ethernet.cloned-mac-address random

With the fix, it still works to specify the type later:

  $ nmcli connection add ifname eth1 con-name ethie autoconnect no ipv4.method auto type ethernet

but it doesn't work, to specify the type after type-specific options:

  $ nmcli connection add ifname eth1 con-name ethie autoconnect no ipv4.method auto ethernet.cloned-mac-address random type ethernet
  Error: invalid or not allowed setting 'ethernet': 'ethernet' not among [connection, ipv4, ipv6, proxy].

The patch doesn't change the latter limitation.

Fixes: c5324ed285
2017-10-26 19:07:24 +02:00
..
cli nmcli: fix wrongly adding a generic setting when constructing connection 2017-10-26 19:07:24 +02:00
common core,clients: use our own string hashing function nm_str_hash() 2017-10-18 13:05:00 +02:00
tui core,clients: use our own string hashing function nm_str_hash() 2017-10-18 13:05:00 +02:00
nm-online.c nm-online: fix wrong assertion failure during nm-online 2017-02-07 19:42:30 +01:00