NetworkManager/libnm
Dan Williams abc700c5c7 libnm-glib/libnm/vpn: fix handling of ConnectInteractive() failure (rh #1298732)
If the plugin supports interactive mode, but the VPN binary (like vpnc
or openvpn) doesn't support it, then the plugin should return
NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED from its connect_interactive()
hook.  This lets NetworkManager know to fall back to plain Connect().

Since this notification is done through an error return, the VPN service
plugin code sees the failure and moves the plugin state back to
STOPPED.  NetworkManager sees that state change, and terminates the
connection attempt while waiting for a reply to the Connect() method.

(VPN service plugins that don't support interactive mode at all don't
have this problem because that error is returned before the plugin's
state is moved to STARTING.)

To fix this, do two things:

1) if the connect_interactive() hook fails and returns the error
NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED, postpone the STOPPED
state change for a few seconds to allow NM time to fall back to
plain Connect().  We still want to move the plugin state back to
STOPPED eventually, because otherwise it could stay in STARTING
forever.

2) change state to STARTING only if the connect/connect_interactive
plugin hooks were successful.  Otherwise the plugin would still be
in STARTING state, and it's not valid to call Connect()/ConnectInteractive()
during the STARTING state.

https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00091.html
https://bugzilla.redhat.com/show_bug.cgi?id=1298732
2016-03-02 11:27:17 +01:00
..
tests all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
generate-plugin-docs.pl trivial: fix a comment typo in generate-plugin-docs.pl 2014-11-19 17:54:03 +01:00
generate-setting-docs.py python: use gi.require_version() in generate-setting-docs.py and examples 2015-11-11 10:56:05 +01:00
libnm.pc.in libnm,pkg-config: provide a variable with VPN service directory 2015-08-19 15:13:11 +02:00
libnm.ver libnm,core,cli: move dhcp-timeout property to generic NMSettingIPConfig 2016-02-16 11:37:26 +01:00
Makefile.am build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
NetworkManager.h libnm: include "nm-vpn-service-plugin.h" in "NetworkManager.h" 2016-01-27 17:20:09 +01:00
nm-access-point.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-access-point.h libnm: add NM_AVAILABLE_IN_1_2 for API nm_access_point_get_last_seen() 2015-08-09 14:37:10 +02:00
nm-active-connection.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-active-connection.h libnm: create NMDhcpConfig as parent of NMDhcp4Config and NMDhcp6Config 2014-11-07 07:49:40 -05:00
nm-client.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-client.h libnm/libnm-glib: add NMClient.get_all_devices() method and AllDevices property 2015-12-04 12:16:41 +01:00
nm-dbus-helpers.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-dbus-helpers.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-device-adsl.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-adsl.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-bond.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-bond.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-bridge.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-bridge.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-bt.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-bt.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-ethernet.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-ethernet.h libnm: add 390-subchannels property to NMDeviceEthernet 2015-09-29 09:31:25 +02:00
nm-device-generic.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-generic.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-infiniband.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-infiniband.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-ip-tunnel.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-ip-tunnel.h libnm: add NMDeviceIPTunnel 2015-12-01 17:39:41 +01:00
nm-device-macvlan.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-macvlan.h libnm: add NMDeviceMacvlan 2015-12-09 14:30:08 +01:00
nm-device-modem.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-modem.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-olpc-mesh.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-olpc-mesh.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-private.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-device-team.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-team.h libnm: merge device-type-specific errors into NMDeviceError 2014-10-22 08:29:08 -04:00
nm-device-tun.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-tun.h libnm: add NMDeviceTun 2015-11-25 11:39:57 +01:00
nm-device-vlan.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-vlan.h libnm: add :parent property for VLAN devices 2014-11-24 10:33:22 +01:00
nm-device-vxlan.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-vxlan.h libnm: add NMDeviceVxlan 2015-12-09 16:36:46 +01:00
nm-device-wifi.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-wifi.h libnm: add new functions allowing passing options to RequestScan() D-Bus call 2015-08-14 11:27:15 +02:00
nm-device-wimax.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-device-wimax.h wimax: drop WiMAX support (bgo #747846) 2015-04-17 12:42:23 -04:00
nm-device.c libnm,core: fix syntax of 'transfer' annotation 2016-02-24 17:23:01 +01:00
nm-device.h device: fix signature for @flags argument of impl_device_reapply() 2016-02-16 11:24:49 +01:00
nm-dhcp-config.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-dhcp-config.h libnm: create NMDhcpConfig as parent of NMDhcp4Config and NMDhcp6Config 2014-11-07 07:49:40 -05:00
nm-dhcp4-config.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-dhcp4-config.h libnm: create NMDhcpConfig as parent of NMDhcp4Config and NMDhcp6Config 2014-11-07 07:49:40 -05:00
nm-dhcp6-config.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-dhcp6-config.h libnm: create NMDhcpConfig as parent of NMDhcp4Config and NMDhcp6Config 2014-11-07 07:49:40 -05:00
nm-ip-config.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-ip-config.h libnm: create NMIPConfig as parent of NMIP4Config and NMIP6Config 2014-11-07 07:49:40 -05:00
nm-ip4-config.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-ip4-config.h libnm: create NMIPConfig as parent of NMIP4Config and NMIP6Config 2014-11-07 07:49:40 -05:00
nm-ip6-config.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-ip6-config.h libnm: create NMIPConfig as parent of NMIP4Config and NMIP6Config 2014-11-07 07:49:40 -05:00
nm-manager.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-manager.h libnm/libnm-glib: add NMClient.get_all_devices() method and AllDevices property 2015-12-04 12:16:41 +01:00
nm-object-cache.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-object-cache.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-object-private.h all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
nm-object.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-object.h libnm: consolidate NMClientError and NMObjectError 2014-10-22 08:29:10 -04:00
nm-remote-connection-private.h libnm: add libnm/libnm-core (part 1) 2014-08-01 14:34:04 -04:00
nm-remote-connection.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-remote-connection.h libnm: drop unused NMRemoteConnectionError 2014-10-22 08:29:08 -04:00
nm-remote-settings.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-remote-settings.h libnm: change GSList to GPtrArray in libnm methods 2014-10-28 17:17:17 -04:00
nm-secret-agent-old.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-secret-agent-old.h libnm: (trivial) correct an example in NMSecretAgentOldGetSecretsFunc docs 2014-11-26 14:07:46 +01:00
nm-types.h libnm: add NMDeviceVxlan 2015-12-09 16:36:46 +01:00
nm-vpn-connection.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-vpn-connection.h libnm: add nm-types.h, to avoid include loops 2014-10-10 13:10:18 -04:00
nm-vpn-editor.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-vpn-editor.h libnm: move NMVpnEditorPlugin to libnm-core/ 2015-07-29 22:34:35 +02:00
nm-vpn-plugin-old.c libnm-glib/libnm/vpn: fix handling of ConnectInteractive() failure (rh #1298732) 2016-03-02 11:27:17 +01:00
nm-vpn-plugin-old.h libnm/vpn: deprecated NMVpnPluginOld 2015-07-29 22:34:35 +02:00
nm-vpn-service-plugin.c libnm-glib/libnm/vpn: fix handling of ConnectInteractive() failure (rh #1298732) 2016-03-02 11:27:17 +01:00
nm-vpn-service-plugin.h libnm: include "nm-vpn-service-plugin.h" in "NetworkManager.h" 2016-01-27 17:20:09 +01:00
nm-wimax-nsp.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-wimax-nsp.h libnm, docs: docs fixes 2014-11-07 13:16:54 -05:00