From 19133b08daf97fedeeb3bd9d76bb8e58f87951a4 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 23 Jun 2016 22:46:02 +0200 Subject: [PATCH] vpn: dispatch pre-up scripts only once If the plugin sends a new configuration when the connection is already activated the state should not go back to PRE_UP since this causes dispatcher scripts to run again. --- src/vpn-manager/nm-vpn-connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index b2aa8f6bc..84021d3c2 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -1082,7 +1082,8 @@ nm_vpn_connection_apply_config (NMVpnConnection *self) nm_default_route_manager_ip6_update_default_route (priv->default_route_manager, self); _LOGI ("VPN connection: (IP Config Get) complete"); - _set_vpn_state (self, STATE_PRE_UP, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE); + if (priv->vpn_state < STATE_PRE_UP) + _set_vpn_state (self, STATE_PRE_UP, NM_VPN_CONNECTION_STATE_REASON_NONE, FALSE); return TRUE; }