[next] telepathy-mission-control: connectivity_monitor_nm_state_change_cb: if NM says DISCONNECTED, believe it

Simon McVittie smcv at kemper.freedesktop.org
Fri Sep 27 07:01:58 PDT 2013


Module: telepathy-mission-control
Branch: next
Commit: eb6a6bf52c1ed476f6dab871cad491d3fff5c8f5
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=eb6a6bf52c1ed476f6dab871cad491d3fff5c8f5

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Thu Sep 19 19:39:24 2013 +0100

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 at collabora.co.uk>

---

 src/connectivity-monitor.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/connectivity-monitor.c b/src/connectivity-monitor.c
index 7fac1ec..b1b03a1 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);



More information about the telepathy-commits mailing list