NetworkManager/src/nmcli
Thomas Haller d0349f17b7
cli: fail nmcli connection up $PROFILE ifname $DEVICE for non-existing virtual device
$ nmcli connection add type dummy con-name x autoconnect no ipv4.method disabled ipv6.method disabled ifname d0
  $ mcli connection up x ifname bogus
  Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)

This is not right. A non-existing ifname argument was simply ignored
and nmcli would tell NetworkManager to activate the profile (on any
device).

Instead, if the user specifies a device argument, also for a virtual
type, it must exist.

Note that usually for virtual devices (like 'dummy'), the device
in fact does not exist, so passing `ifname` is likely to fail.
If the device already exists, then the command is no going to work
as expected, with

  $ mcli connection up x ifname d0

succeeding, while

  $ mcli connection up x ifname d1

fails (as intended) with

  Error: device 'd1' not compatible with connection 'x': The interface names of the device and the connection didn't match..
2021-07-08 17:20:15 +02:00
..
agent.c cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
common.c nmcli: remove nmc_dbus_call_sync() 2021-05-03 22:22:01 +02:00
common.h nmcli: remove nmc_dbus_call_sync() 2021-05-03 22:22:01 +02:00
connections.c cli: fail nmcli connection up $PROFILE ifname $DEVICE for non-existing virtual device 2021-07-08 17:20:15 +02:00
connections.h cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
devices.c cli: minor cleanup of code in "devices.c" 2021-05-27 10:42:10 +02:00
devices.h cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
general.c nmcli: invoke Reload() D-Bus method asynchronously 2021-05-03 22:22:01 +02:00
generate-docs-nm-settings-nmcli.c cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
generate-docs-nm-settings-nmcli.xml.in all: add a new ipv{4,6}.required-timeout property 2021-07-05 15:15:44 +02:00
meson.build build: fix linking libnm-log-null into different test programs 2021-07-05 14:51:27 +02:00
nmcli-completion bash-completion: localize the prev variable 2021-06-08 11:38:45 +02:00
nmcli.c all: don't explicitly include <glib-unix.h> 2021-06-28 13:31:34 +02:00
nmcli.h cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
polkit-agent.c cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
polkit-agent.h cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
settings.c cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
settings.h cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
utils.c cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
utils.h cli: use const argument for nmc_string_is_valid() 2021-05-03 10:11:20 +02:00