diff options
author | Dan Williams <dcbw@redhat.com> | 2014-06-04 14:57:29 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-06-06 13:43:46 -0500 |
commit | beb5529c42a9dda3f7e234b6a1988209179f71d2 (patch) | |
tree | 7f50e7182c6ca5f5097457fc06c490c5215765f8 | |
parent | e1ec6a51737be00ad98cd013059924bc68b1712b (diff) | |
download | NetworkManager-beb5529c42a9dda3f7e234b6a1988209179f71d2.tar.gz |
vpn: make DOWN dispatcher action block on quit
Since the event loop isn't running on quit, but we want to ensure that
scripts can fully process the DOWN event, block on scripts completing
when disconnecting the VPN when quitting.
-rw-r--r-- | src/vpn-manager/nm-vpn-connection.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index 052ebfe4b1..dea366be1b 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -373,15 +373,24 @@ _set_vpn_state (NMVPNConnection *connection, if ( old_vpn_state >= STATE_ACTIVATED && old_vpn_state <= STATE_DEACTIVATING) { /* Let dispatcher scripts know we're about to go down */ - nm_dispatcher_call_vpn (DISPATCHER_ACTION_VPN_DOWN, - priv->connection, - parent_dev, - priv->ip_iface, - NULL, - NULL, - NULL, - NULL, - NULL); + if (quitting) { + nm_dispatcher_call_vpn_sync (DISPATCHER_ACTION_VPN_DOWN, + priv->connection, + parent_dev, + priv->ip_iface, + NULL, + NULL); + } else { + nm_dispatcher_call_vpn (DISPATCHER_ACTION_VPN_DOWN, + priv->connection, + parent_dev, + priv->ip_iface, + NULL, + NULL, + NULL, + NULL, + NULL); + } } /* Tear down and clean up the connection */ |