NetworkManager/src/core/devices
Thomas Haller 7af9562f28
device: fix available-connections for a device for user-request
There are two callers of available_connections_add(). One from
cp_connection_added_or_updated() (which is when a connection
gets added/modified) and one from nm_device_recheck_available_connections().

They both call first nm_device_check_connection_available() to see
whether the profile is available on the device. They certainly
need to pass the same check flags, otherwise a profile might
be available in some cases, and not in others.

I didn't actually test this, but I think this could result
in a profile wrongly not being listed as an available-connection.
Moreover, that might mean, that `nmcli connection up $PROFILE`
might work to find the device/profile, but `nmcli device up $DEVICE`
couldn't find the suitable profile (because the latter calls
nm_device_get_best_connection(), which iterates the
available-connections). I didn't test this, because regardless of
that, it seems obvious that the conditions for when we call
available_connections_add() must be the same from both places.
So the only question is what is the right condition, and it would
seem that _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST is the right
flag.

Fixes: 02dbe670ca ('device: for available connections check whether they are available for user-request')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1496
2023-01-17 09:34:28 +01:00
..
adsl all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
bluetooth all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
ovs all: add support for ovs-dpdk n-rxq-desc and n-txq-desc 2023-01-17 08:45:04 +01:00
team all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
tests lldp: use new libnm-lldp instead of systemd's sd_lldp_rx 2022-10-25 10:59:01 +02:00
wifi all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
wwan all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
meson.build all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-6lowpan.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-6lowpan.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-bond.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-bond.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-bridge.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-bridge.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-dummy.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-dummy.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-ethernet-utils.c all: add "src/core/nm-default-daemon.h" as replacement for "nm-default.h" 2021-02-09 12:38:18 +01:00
nm-device-ethernet-utils.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-device-ethernet.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-ethernet.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-factory.c support loopback interface 2022-11-23 20:51:22 +01:00
nm-device-factory.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-generic.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-generic.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-infiniband.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-infiniband.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-ip-tunnel.c devices: support VTI6 tunnels 2022-12-21 14:04:44 +01:00
nm-device-ip-tunnel.h devices: support VTI tunnels 2022-12-21 14:04:44 +01:00
nm-device-logging.h all: avoid "-Wunreachable-code-generic-assoc" warning with _Generic() 2022-10-11 17:21:11 +02:00
nm-device-loopback.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-loopback.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-macsec.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-macsec.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-macvlan.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-macvlan.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-ppp.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-ppp.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-private.h device: add "update_carrier" argument to nm_device_bring_up_full() 2022-11-16 10:22:45 +01:00
nm-device-tun.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-tun.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-utils.c glib-aux: rename IP address related helpers from "nm-inet-utils.h" 2022-08-25 19:05:51 +02:00
nm-device-utils.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-device-veth.c veth: fix detection of existing interfaces in create_and_realize() 2022-12-19 10:47:13 +01:00
nm-device-veth.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-vlan.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-vlan.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-vrf.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-vrf.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-vxlan.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-vxlan.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-wireguard.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-wireguard.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-wpan.c all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device-wpan.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-device.c device: fix available-connections for a device for user-request 2023-01-17 09:34:28 +01:00
nm-device.h Revert "policy: track the autoconnect retries in devices for multi-connect" 2022-12-20 16:12:43 +01:00
nm-lldp-listener.c devices: remove unneeded pointer check 2022-12-22 11:39:08 +01:00
nm-lldp-listener.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00