After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776001 - Manager state bounces endlessly between CONNECTING and CONNECTED_SITE
Manager state bounces endlessly between CONNECTING and CONNECTED_SITE
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-review
 
 
Reported: 2016-12-12 17:15 UTC by Beniamino Galvani
Modified: 2016-12-14 09:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Beniamino Galvani 2016-12-12 17:15:02 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
Comment 1 Beniamino Galvani 2016-12-12 17:17:15 UTC
Fix in branch bg/manager-state-bgo776001, please review.
Comment 2 Thomas Haller 2016-12-12 20:43:46 UTC
lgtm
Comment 3 Francesco Giudici 2016-12-13 11:03:08 UTC
+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
Comment 4 Beniamino Galvani 2016-12-14 09:19:31 UTC
(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