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 723350 - NM 0.9.8.8 doesn't properly set the default connectivity check interval if it's not set in config
NM 0.9.8.8 doesn't properly set the default connectivity check interval if it...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
0.9.8
Other Linux
: Normal normal
: ---
Assigned To: Lubomir Rintel
NetworkManager maintainer(s)
Depends on:
Blocks: nm-review
 
 
Reported: 2014-01-31 09:09 UTC by Mathieu Trudel-Lapierre
Modified: 2015-05-19 14:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
set default value for connectivity check interval if missing (3.04 KB, patch)
2014-01-31 09:09 UTC, Mathieu Trudel-Lapierre
none Details | Review
nm-connectivity: default the check interval to 300 seconds (1.34 KB, text/plain)
2015-02-07 17:48 UTC, Lubomir Rintel
  Details
connectivty: allow missing connectivity.interval argument as fallback to 300 (2.64 KB, patch)
2015-02-19 13:30 UTC, Thomas Haller
none Details | Review

Description Mathieu Trudel-Lapierre 2014-01-31 09:09:05 UTC
Created attachment 267710 [details] [review]
set default value for connectivity check interval if missing

While the man page mentions that the interval would be set to 300 seconds when missing from /etc/NetworkManager/NetworkManager.conf, it appears to remain at 0.

This breaks the first check for connectivity on connection; the initial run_check never run, and not timeout is set for a recurring check.
Comment 1 Dan Williams 2014-04-25 16:38:46 UTC
Review of attachment 267710 [details] [review]:

::: src/nm-config.c
@@ +196,3 @@
+				 */
+				config->connectivity_interval = NM_CONNECTIVITY_DEFAULT_INTERVAL;
+			}

Need to g_clear_error (&err); here.

::: include/NetworkManager.h
@@ +70,3 @@
 
+#define NM_CONNECTIVITY_DEFAULT_INTERVAL	300
+

I'd rather keep this out of NetworkManager.h since it's not really useful as part of the API.  Instead, I'd like to put it into nm-config.h I think.
Comment 2 Lubomir Rintel 2015-02-07 17:48:43 UTC
Created attachment 296337 [details]
nm-connectivity: default the check interval to 300 seconds

Hm, this no longer applies and I find leetting the NMConfig know about the NMConnectivity defaults somewhat unnecessarily complex.

However the bug is still there.

Would this work instead?
Comment 3 Thomas Haller 2015-02-19 13:30:13 UTC
Created attachment 297264 [details] [review]
connectivty: allow missing connectivity.interval argument as fallback to 300

Manual page claims that a missing configuration option for connectivity
interval means "300". That was not the case for a long time (never?).
Comment 4 Thomas Haller 2015-02-19 13:33:15 UTC
if this behavior was never implemented as the manual page claims, we could also fix the manual page and don't change the source.


Otherwise, I agree to the patch from comment 1 -- apart from NM_CONNECTIVITY_DEFAULT_INTERVAL. I think the right place for it is in nm-config.h

On master, the correct solution is IMO comment 3, not comment 2 :)
Comment 5 Thomas Haller 2015-02-19 13:36:10 UTC
(In reply to Lubomir Rintel from comment #2)
> Created attachment 296337 [details]
> nm-connectivity: default the check interval to 300 seconds
> 
> Hm, this no longer applies and I find leetting the NMConfig know about the
> NMConnectivity defaults somewhat unnecessarily complex.

IMO it's correct that NMConfig is aware of the default values for configurations...
Comment 6 Thomas Haller 2015-05-19 13:42:53 UTC
Pushed a modified version of attachment 297264 [details] [review] to

master:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=652853e0d0749a12db07e34f1a3cd901020a76f8

nm-1-0:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=928494af2bde1c188943b126c018a9247cd849b1



As I said, I am pretty sure that attachment 296337 [details] is wrong, because it coerces 0 to 300 -- but zero is valid and means "disabled".
Comment 7 Thomas Haller 2015-05-19 14:45:12 UTC
I also applied a modified version of attachement 267710 on

nm-0-9-8:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=24e9b904279ddf6107ffde2609db5565cda5ffb5


and backported from master to nm-0-9-10:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=c12d6edf23c4ae262e5addf1a891203167717511