From 5895a676765201c8a3c5c7a10154ca1d2a0840ee Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 19 Sep 2013 19:39:24 +0100 Subject: [PATCH 4/5] connectivity_monitor_nm_state_change_cb: if NM says DISCONNECTED, believe it Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 --- src/connectivity-monitor.c | 10 +++++++--- 1 file 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); -- 1.8.4.rc3