summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-11-19 10:33:11 +0100
committerLubomir Rintel <lkundrak@v3.sk>2016-11-21 13:53:03 +0100
commitbf70ed2e868a4be60cbc0d7e8235d969e2704e39 (patch)
treeb50c41c4726e01239231c6b400935ed289f1cc12
parent0f867d31c1e4b6c268d7308e38e2bda1e6e43572 (diff)
downloadNetworkManager-bf70ed2e868a4be60cbc0d7e8235d969e2704e39.tar.gz
vpn-manager: ignore ip configs from disconnected plugins
Plugins could be already failed or disconnected when the helper fires. E.g. they could send in an invalid IP4Config that would cause them to fail and then follow with an IP6Config before they realize it's of no use. We'd hit an assertion failure in that case, because the NMVpnConnection would already be cleaned up.
-rw-r--r--src/vpn-manager/nm-vpn-connection.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index fbdd77e993..4158831007 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -1408,6 +1408,11 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
if (priv->vpn_state == STATE_CONNECT)
_set_vpn_state (self, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ if (priv->vpn_state > STATE_ACTIVATED) {
+ _LOGI ("VPN connection: (IP4 Config Get) ignoring, the connection is no longer active");
+ return;
+ }
+
if (priv->has_ip4) {
_LOGI ("VPN connection: (IP4 Config Get) reply received");
@@ -1577,6 +1582,11 @@ nm_vpn_connection_ip6_config_get (NMVpnConnection *self, GVariant *dict)
if (priv->vpn_state == STATE_CONNECT)
_set_vpn_state (self, STATE_IP_CONFIG_GET, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE);
+ if (priv->vpn_state > STATE_ACTIVATED) {
+ _LOGI ("VPN connection: (IP6 Config Get) ignoring, the connection is no longer active");
+ return;
+ }
+
if (g_variant_n_children (dict) == 0) {
priv->has_ip6 = FALSE;
nm_vpn_connection_config_maybe_complete (self, TRUE);