Send connman mailing list submissions to connman@lists.01.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.01.org/mailman/listinfo/connman or, via email, send a message with subject or body 'help' to connman-requ...@lists.01.org
You can reach the person managing the list at connman-ow...@lists.01.org When replying, please edit your Subject line so it is more specific than "Re: Contents of connman digest..." Today's Topics: 1. [PATCH v2 0/3] Add UseGatewaysAsTimeservers option (Chris Novakovic) 2. [PATCH v2 1/3] main: add UseGatewaysAsTimeservers option (Chris Novakovic) 3. [PATCH v2 2/3] timeserver: use gateways as timeservers if UseGatewaysAsTimeservers=true (Chris Novakovic) 4. [PATCH v2 3/3] main.conf: document UseGatewaysAsTimeservers option (Chris Novakovic) ---------------------------------------------------------------------- Message: 1 Date: Sun, 27 May 2018 17:02:51 +0100 From: Chris Novakovic <ch...@chrisn.me.uk> To: connman@lists.01.org Subject: [PATCH v2 0/3] Add UseGatewaysAsTimeservers option Message-ID: <20180527160254.8972-1-ch...@chrisn.me.uk> This series implements a UseGatewaysAsTimeservers option for main.conf, which can be used to control ConnMan's behaviour of adding service gateways to the list of timeservers. Chris Novakovic (3): main: add UseGatewaysAsTimeservers option timeserver: use gateways as timeservers if UseGatewaysAsTimeservers=true main.conf: document UseGatewaysAsTimeservers option doc/connman.conf.5.in | 11 ++++++++--- src/main.c | 14 ++++++++++++++ src/main.conf | 10 +++++++--- src/timeserver.c | 21 ++++++++++++--------- 4 files changed, 41 insertions(+), 15 deletions(-) -- 2.14.1 ------------------------------ Message: 2 Date: Sun, 27 May 2018 17:02:52 +0100 From: Chris Novakovic <ch...@chrisn.me.uk> To: connman@lists.01.org Subject: [PATCH v2 1/3] main: add UseGatewaysAsTimeservers option Message-ID: <20180527160254.8972-2-ch...@chrisn.me.uk> Add support for a new boolean option UseGatewaysAsTimeservers to the [General] section of main.conf. --- src/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.c b/src/main.c index 318bf02b..ad8595e0 100644 --- a/src/main.c +++ b/src/main.c @@ -81,6 +81,7 @@ static struct { char *vendor_class_id; bool enable_online_check; bool auto_connect_roaming_services; + bool use_gateways_as_timeservers; } connman_settings = { .bg_scan = true, .pref_timeservers = NULL, @@ -100,6 +101,7 @@ static struct { .vendor_class_id = NULL, .enable_online_check = true, .auto_connect_roaming_services = false, + .use_gateways_as_timeservers = false, }; #define CONF_BG_SCAN "BackgroundScanning" @@ -120,6 +122,7 @@ static struct { #define CONF_VENDOR_CLASS_ID "VendorClassID" #define CONF_ENABLE_ONLINE_CHECK "EnableOnlineCheck" #define CONF_AUTO_CONNECT_ROAMING_SERVICES "AutoConnectRoamingServices" +#define CONF_USE_GATEWAYS_AS_TIMESERVERS "UseGatewayAsTimeservers" static const char *supported_options[] = { CONF_BG_SCAN, @@ -140,6 +143,7 @@ static const char *supported_options[] = { CONF_VENDOR_CLASS_ID, CONF_ENABLE_ONLINE_CHECK, CONF_AUTO_CONNECT_ROAMING_SERVICES, + CONF_USE_GATEWAYS_AS_TIMESERVERS, NULL }; @@ -431,6 +435,13 @@ static void parse_config(GKeyFile *config) connman_settings.auto_connect_roaming_services = boolean; g_clear_error(&error); + + boolean = __connman_config_get_bool(config, "General", + CONF_USE_GATEWAYS_AS_TIMESERVERS, &error); + if (!error) + connman_settings.use_gateways_as_timeservers = boolean; + + g_clear_error(&error); } static int config_init(const char *file) @@ -644,6 +655,9 @@ bool connman_setting_get_bool(const char *key) if (g_str_equal(key, CONF_AUTO_CONNECT_ROAMING_SERVICES)) return connman_settings.auto_connect_roaming_services; + if (g_str_equal(key, CONF_USE_GATEWAYS_AS_TIMESERVERS)) + return connman_settings.use_gateways_as_timeservers; + return false; } -- 2.14.1 ------------------------------ Message: 3 Date: Sun, 27 May 2018 17:02:53 +0100 From: Chris Novakovic <ch...@chrisn.me.uk> To: connman@lists.01.org Subject: [PATCH v2 2/3] timeserver: use gateways as timeservers if UseGatewaysAsTimeservers=true Message-ID: <20180527160254.8972-3-ch...@chrisn.me.uk> Rather than always assuming that service gateways are capable of functioning as timeservers, only do so if UseGatewaysAsTimeservers is set to true in main.conf. --- src/timeserver.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/timeserver.c b/src/timeserver.c index 393c64c1..d59e6013 100644 --- a/src/timeserver.c +++ b/src/timeserver.c @@ -268,15 +268,18 @@ GSList *__connman_timeserver_get_all(struct connman_service *service) for (i = 0; service_ts && service_ts[i]; i++) list = __connman_timeserver_add_list(list, service_ts[i]); - network = __connman_service_get_network(service); - if (network) { - index = connman_network_get_index(network); - service_gw = __connman_ipconfig_get_gateway_from_index(index, - CONNMAN_IPCONFIG_TYPE_ALL); - - /* Then add Service Gateway to the list */ - if (service_gw) - list = __connman_timeserver_add_list(list, service_gw); + /* Then add Service Gateway to the list, if UseGatewaysAsTimeservers + * configuration option is set to true */ + if (connman_setting_get_bool("UseGatewaysAsTimeservers")) { + network = __connman_service_get_network(service); + if (network) { + index = connman_network_get_index(network); + service_gw = __connman_ipconfig_get_gateway_from_index(index, + CONNMAN_IPCONFIG_TYPE_ALL); + + if (service_gw) + list = __connman_timeserver_add_list(list, service_gw); + } } /* Then add Global Timeservers to the list */ -- 2.14.1 ------------------------------ Message: 4 Date: Sun, 27 May 2018 17:02:54 +0100 From: Chris Novakovic <ch...@chrisn.me.uk> To: connman@lists.01.org Subject: [PATCH v2 3/3] main.conf: document UseGatewaysAsTimeservers option Message-ID: <20180527160254.8972-4-ch...@chrisn.me.uk> When UseGatewaysAsTimeservers is set to true, service gateways are assumed to also function as timeservers. The default is false. Document the behaviour of this option in the connman.conf(5) man page and the sample main.conf. --- doc/connman.conf.5.in | 11 ++++++++--- src/main.conf | 10 +++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/doc/connman.conf.5.in b/doc/connman.conf.5.in index 0e3f8de0..f681ed6a 100644 --- a/doc/connman.conf.5.in +++ b/doc/connman.conf.5.in @@ -52,12 +52,17 @@ When BackgroundScanning is false, ConnMan will not perform any scan regardless of wifi is connected or not, unless it is requested by the user through a D-Bus call. .TP +.BI UseGatewaysAsTimeservers=true \fR|\fB\ false +Assume that service gateways also function as timeservers. +Default is false. +.TP .BI FallbackTimeservers= server\fR[,...] List of Fallback timeservers separated by ",". These timeservers are used for NTP sync when there are -no timeserver set by the user or by the service. -These can contain mixed combination of fully qualified -domain names, IPv4 and IPv6 addresses. +no timeservers set by the user or by the service, and +when UseGatewaysAsTimeservers = false. These can contain +a mixed combination of fully qualified domain names, IPv4 +and IPv6 addresses. .TP .BI FallbackNameservers= server\fR[,...] List of fallback nameservers separated by "," appended diff --git a/src/main.conf b/src/main.conf index 44db1cc1..a7022aa6 100644 --- a/src/main.conf +++ b/src/main.conf @@ -25,11 +25,15 @@ # the user through a D-Bus call. # BackgroundScanning = true +# Assume that service gateways also function as timeservers. +# UseGatewaysAsTimeservers = false + # List of Fallback timeservers separated by ",". # These timeservers are used for NTP sync when there are -# no timeserver set by the user or by the service. -# These can contain mixed combination of fully qualified -# domain names, IPv4 and IPv6 addresses. +# no timeservers set by the user or by the service, and +# when UseGatewaysAsTimeservers = false. These can contain +# mixed combination of fully qualified domain names, IPv4 +# and IPv6 addresses. # FallbackTimeservers = # List of fallback nameservers separated by "," used if no -- 2.14.1 ------------------------------ Subject: Digest Footer _______________________________________________ connman mailing list connman@lists.01.org https://lists.01.org/mailman/listinfo/connman ------------------------------ End of connman Digest, Vol 31, Issue 18 ***************************************