cli: don't track device state for VPN connections

Currently nmcli considers the state of the device associated to a
connection to determine the success of an activation; for VPNs the
device is the parent interface on which the VPN is established.

This means that VPNs on bond/bridge/team interfaces are reported as
connected immediately because of the special handling of master
devices state in check_activated().

The parent device state is not meaningful for VPNs, so don't track it.
This commit is contained in:
Beniamino Galvani
2017-07-09 16:03:23 +02:00
parent b535ecc23a
commit f395a0c29b

View File

@@ -2291,7 +2291,7 @@ activate_connection_cb (GObject *client, GAsyncResult *result, gpointer user_dat
activate_connection_info_finish (info);
} else {
state = nm_active_connection_get_state (active);
if (!device) {
if (!device && !nm_active_connection_get_vpn (active)) {
/* device could be NULL for virtual devices. Fill it here. */
ac_devs = nm_active_connection_get_devices (active);
device = ac_devs->len > 0 ? g_ptr_array_index (ac_devs, 0) : NULL;