GNOME Bugzilla – Bug 776001
Manager state bounces endlessly between CONNECTING and CONNECTED_SITE
Last modified: 2016-12-14 09:19:31 UTC
After commit [1] the manager state can bounce endlessly between CONNECTING and CONNECTED_SITE: [3.3417] manager: NetworkManager state is now CONNECTED_SITE [3.3417] connectivity: check: send request to 'http://fedoraproject.org/static/hotspot.txt' [3.3417] manager: NetworkManager state is now CONNECTING [3.3418] connectivity: check: send request to 'http://fedoraproject.org/static/hotspot.txt' [3.3419] connectivity: check: send request to 'http://fedoraproject.org/static/hotspot.txt' [3.3421] connectivity: check for uri 'http://fedoraproject.org/static/hotspot.txt' failed with 'Error resolving 'fedoraproject.org': Name or service not known' [3.3421] manager: NetworkManager state is now CONNECTED_SITE [3.3421] connectivity: check: send request to 'http://fedoraproject.org/static/hotspot.txt' [3.3422] manager: NetworkManager state is now CONNECTING [3.3422] connectivity: check: send request to 'http://fedoraproject.org/static/hotspot.txt' [3.3423] connectivity: check: send request to 'http://fedoraproject.org/static/hotspot.txt' [3.3425] connectivity: check for uri 'http://fedoraproject.org/static/hotspot.txt' failed with 'Error resolving 'fedoraproject.org': Name or service not known' [3.3425] manager: NetworkManager state is now CONNECTED_SITE [3.3425] connectivity: check: send request to 'http://fedoraproject.org/static/hotspot.txt' [3.3426] manager: NetworkManager state is now CONNECTING [1] https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=084da69a305be740b5e3cd3e6d3a9a827657a81d
Fix in branch bg/manager-state-bgo776001, please review.
lgtm
+do_networking_connectivity (NmCli *nmc, int argc, char **argv) +{ + if (nmc->complete) { + if (argc == 1) + nmc_complete_strings (*argv, "check", NULL); + return nmc->return_value; + } + + if (!argc) { + /* no arguments -> get current state */ + nmc_switch_show (nmc, NMC_FIELDS_NM_CONNECTIVITY, _("Connectivity")); + } else if (matches (*argv, "check") == 0) { + gs_free_error GError *error = NULL; + + /* Register polkit agent */ + nmc_start_polkit_agent_start_try (nmc); + + nm_client_check_connectivity (nmc->client, NULL, &error); + if (error) { + g_string_printf (nmc->return_text, _("Error: %s."), error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } else + nmc_switch_show (nmc, NMC_FIELDS_NM_CONNECTIVITY, _("Connectivity")); + } else { if (nmc->complete) return nmc->return_value; this ^^^ nmc->complete check can be now removed too, as it is already checked at the beginning of the function. Branch lgtm
(In reply to Francesco Giudici from comment #3) > this ^^^ nmc->complete check can be now removed too, as it is already > checked at the beginning of the function. This commit was actually not part of the branch and already in master. I've added a new commit to fix it. > Branch lgtm Thanks, merged: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a7938a5b2ced3777d10f9c36ca8006d8f1a44c2a