summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-19 19:39:24 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-20 12:51:06 +0100
commiteb6a6bf52c1ed476f6dab871cad491d3fff5c8f5 (patch)
tree982e58af3b2a9a438b7a7fcd98316997bbf3470c
parent5336208b2848c810c0e9168cc629f9a63593f9ac (diff)
downloadtelepathy-mission-control-eb6a6bf52c1ed476f6dab871cad491d3fff5c8f5.tar.gz
connectivity_monitor_nm_state_change_cb: if NM says DISCONNECTED, believe it
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--src/connectivity-monitor.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/connectivity-monitor.c b/src/connectivity-monitor.c
index 7fac1ec8..b1b03a1a 100644
--- a/src/connectivity-monitor.c
+++ b/src/connectivity-monitor.c
@@ -209,9 +209,6 @@ connectivity_monitor_nm_state_change_cb (NMClient *client,
state = nm_client_get_state (priv->nm_client);
- /* Deliberately not checking for DISCONNECTED. If we are really disconnected,
- * the netlink GNetworkMonitor will say so; or if we have non-NM connectivity
- * with a default route, we might as well give it a try. */
if (state == NM_STATE_CONNECTING
#if NM_CHECK_VERSION(0,8,992)
|| state == NM_STATE_DISCONNECTING
@@ -223,6 +220,13 @@ connectivity_monitor_nm_state_change_cb (NMClient *client,
connectivity_monitor_remove_states (connectivity_monitor,
CONNECTIVITY_STABLE, NULL);
}
+ else if (state == NM_STATE_DISCONNECTED)
+ {
+ DEBUG ("New NetworkManager network state %d (disconnected)", state);
+
+ connectivity_monitor_remove_states (connectivity_monitor,
+ CONNECTIVITY_UP|CONNECTIVITY_STABLE, NULL);
+ }
else
{
DEBUG ("New NetworkManager network state %d (stable state)", state);