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] service: Do not set domainname if AllowDomainnameUpdates is false (Bertrand Jacquin) 2. [PATCH v2] service: Do not set domainname if AllowDomainnameUpdates is false (Bertrand Jacquin) 3. ConnMan sometimes shutting down, sometimes not restarting (Craig McQueen) 4. [PATCH] firewall-iptables: Avoid string reallocation (Santtu Lakkala) 5. Re: making Scan method asynchronous (Vasyl Vavrychuk) ---------------------------------------------------------------------- Message: 1 Date: Wed, 21 Feb 2018 03:33:55 +0000 From: Bertrand Jacquin <bertr...@jacquin.bzh> To: conn...@connman.net Subject: [PATCH] service: Do not set domainname if AllowDomainnameUpdates is false Message-ID: <20180221033355.22072-1-bertr...@jacquin.bzh> Replicating AllowHostnameUpdates since it can be annoying to have local domainname to be overridden (jumping from hotel to hotel) --- doc/connman.conf.5.in | 6 ++++++ src/main.c | 15 +++++++++++++++ src/service.c | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/connman.conf.5.in b/doc/connman.conf.5.in index 1dbed539a4d9..809a0a474707 100644 --- a/doc/connman.conf.5.in +++ b/doc/connman.conf.5.in @@ -104,6 +104,11 @@ Allow connman to change the system hostname. This can happen for example if we receive DHCP hostname option. Default value is true. .TP +.BI AllowDomainnameUpdates=true\ \fR|\fB\ false +Allow connman to change the system domainname. This can +happen for example if we receive DHCP domainname option. +Default value is true. +.TP .BI SingleConnectedTechnology=true\ \fR|\fB\ false Keep only a single connected technology at any time. When a new service is connected by the user or a better one is found according @@ -163,6 +168,7 @@ ethernet tethering. .nf [General] AllowHostnameUpdates = false +AllowDomainnameUpdates = false TetheringTechnologies = ethernet,wifi,bluetooth,gadget .fi .SH "SEE ALSO" diff --git a/src/main.c b/src/main.c index e1532913b78d..318bf02b1833 100644 --- a/src/main.c +++ b/src/main.c @@ -73,6 +73,7 @@ static struct { unsigned int timeout_browserlaunch; char **blacklisted_interfaces; bool allow_hostname_updates; + bool allow_domainname_updates; bool single_tech; char **tethering_technologies; bool persistent_tethering_mode; @@ -91,6 +92,7 @@ static struct { .timeout_browserlaunch = DEFAULT_BROWSER_LAUNCH_TIMEOUT, .blacklisted_interfaces = NULL, .allow_hostname_updates = true, + .allow_domainname_updates = true, .single_tech = false, .tethering_technologies = NULL, .persistent_tethering_mode = false, @@ -110,6 +112,7 @@ static struct { #define CONF_TIMEOUT_BROWSERLAUNCH "BrowserLaunchTimeout" #define CONF_BLACKLISTED_INTERFACES "NetworkInterfaceBlacklist" #define CONF_ALLOW_HOSTNAME_UPDATES "AllowHostnameUpdates" +#define CONF_ALLOW_DOMAINNAME_UPDATES "AllowDomainnameUpdates" #define CONF_SINGLE_TECH "SingleConnectedTechnology" #define CONF_TETHERING_TECHNOLOGIES "TetheringTechnologies" #define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode" @@ -129,6 +132,7 @@ static const char *supported_options[] = { CONF_TIMEOUT_BROWSERLAUNCH, CONF_BLACKLISTED_INTERFACES, CONF_ALLOW_HOSTNAME_UPDATES, + CONF_ALLOW_DOMAINNAME_UPDATES, CONF_SINGLE_TECH, CONF_TETHERING_TECHNOLOGIES, CONF_PERSISTENT_TETHERING_MODE, @@ -366,6 +370,14 @@ static void parse_config(GKeyFile *config) g_clear_error(&error); + boolean = __connman_config_get_bool(config, "General", + CONF_ALLOW_DOMAINNAME_UPDATES, + &error); + if (!error) + connman_settings.allow_domainname_updates = boolean; + + g_clear_error(&error); + boolean = __connman_config_get_bool(config, "General", CONF_SINGLE_TECH, &error); if (!error) @@ -614,6 +626,9 @@ bool connman_setting_get_bool(const char *key) if (g_str_equal(key, CONF_ALLOW_HOSTNAME_UPDATES)) return connman_settings.allow_hostname_updates; + if (g_str_equal(key, CONF_ALLOW_DOMAINNAME_UPDATES)) + return connman_settings.allow_domainname_updates; + if (g_str_equal(key, CONF_SINGLE_TECH)) return connman_settings.single_tech; diff --git a/src/service.c b/src/service.c index bf8064a04e73..ab5b2c6aea19 100644 --- a/src/service.c +++ b/src/service.c @@ -1533,7 +1533,8 @@ static void default_changed(void) connman_setting_get_bool("AllowHostnameUpdates")) __connman_utsname_set_hostname(service->hostname); - if (service->domainname) + if (service->domainname && + connman_setting_get_bool("AllowDomainnameUpdates")) __connman_utsname_set_domainname(service->domainname); } ------------------------------ Message: 2 Date: Wed, 21 Feb 2018 03:40:33 +0000 From: Bertrand Jacquin <bertr...@jacquin.bzh> To: conn...@connman.net Subject: [PATCH v2] service: Do not set domainname if AllowDomainnameUpdates is false Message-ID: <20180221034033.28087-1-bertr...@jacquin.bzh> Replicating AllowHostnameUpdates since it can be annoying to have local domainname to be overridden (jumping from hotel to hotel) --- doc/connman.conf.5.in | 6 ++++++ src/main.c | 15 +++++++++++++++ src/main.conf | 5 +++++ src/service.c | 3 ++- 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/connman.conf.5.in b/doc/connman.conf.5.in index 1dbed539a4d9..809a0a474707 100644 --- a/doc/connman.conf.5.in +++ b/doc/connman.conf.5.in @@ -104,6 +104,11 @@ Allow connman to change the system hostname. This can happen for example if we receive DHCP hostname option. Default value is true. .TP +.BI AllowDomainnameUpdates=true\ \fR|\fB\ false +Allow connman to change the system domainname. This can +happen for example if we receive DHCP domainname option. +Default value is true. +.TP .BI SingleConnectedTechnology=true\ \fR|\fB\ false Keep only a single connected technology at any time. When a new service is connected by the user or a better one is found according @@ -163,6 +168,7 @@ ethernet tethering. .nf [General] AllowHostnameUpdates = false +AllowDomainnameUpdates = false TetheringTechnologies = ethernet,wifi,bluetooth,gadget .fi .SH "SEE ALSO" diff --git a/src/main.c b/src/main.c index e1532913b78d..318bf02b1833 100644 --- a/src/main.c +++ b/src/main.c @@ -73,6 +73,7 @@ static struct { unsigned int timeout_browserlaunch; char **blacklisted_interfaces; bool allow_hostname_updates; + bool allow_domainname_updates; bool single_tech; char **tethering_technologies; bool persistent_tethering_mode; @@ -91,6 +92,7 @@ static struct { .timeout_browserlaunch = DEFAULT_BROWSER_LAUNCH_TIMEOUT, .blacklisted_interfaces = NULL, .allow_hostname_updates = true, + .allow_domainname_updates = true, .single_tech = false, .tethering_technologies = NULL, .persistent_tethering_mode = false, @@ -110,6 +112,7 @@ static struct { #define CONF_TIMEOUT_BROWSERLAUNCH "BrowserLaunchTimeout" #define CONF_BLACKLISTED_INTERFACES "NetworkInterfaceBlacklist" #define CONF_ALLOW_HOSTNAME_UPDATES "AllowHostnameUpdates" +#define CONF_ALLOW_DOMAINNAME_UPDATES "AllowDomainnameUpdates" #define CONF_SINGLE_TECH "SingleConnectedTechnology" #define CONF_TETHERING_TECHNOLOGIES "TetheringTechnologies" #define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode" @@ -129,6 +132,7 @@ static const char *supported_options[] = { CONF_TIMEOUT_BROWSERLAUNCH, CONF_BLACKLISTED_INTERFACES, CONF_ALLOW_HOSTNAME_UPDATES, + CONF_ALLOW_DOMAINNAME_UPDATES, CONF_SINGLE_TECH, CONF_TETHERING_TECHNOLOGIES, CONF_PERSISTENT_TETHERING_MODE, @@ -366,6 +370,14 @@ static void parse_config(GKeyFile *config) g_clear_error(&error); + boolean = __connman_config_get_bool(config, "General", + CONF_ALLOW_DOMAINNAME_UPDATES, + &error); + if (!error) + connman_settings.allow_domainname_updates = boolean; + + g_clear_error(&error); + boolean = __connman_config_get_bool(config, "General", CONF_SINGLE_TECH, &error); if (!error) @@ -614,6 +626,9 @@ bool connman_setting_get_bool(const char *key) if (g_str_equal(key, CONF_ALLOW_HOSTNAME_UPDATES)) return connman_settings.allow_hostname_updates; + if (g_str_equal(key, CONF_ALLOW_DOMAINNAME_UPDATES)) + return connman_settings.allow_domainname_updates; + if (g_str_equal(key, CONF_SINGLE_TECH)) return connman_settings.single_tech; diff --git a/src/main.conf b/src/main.conf index 85401c2e5325..44db1cc1f5c0 100644 --- a/src/main.conf +++ b/src/main.conf @@ -70,6 +70,11 @@ # Default value is true. # AllowHostnameUpdates = true +# Allow connman to change the system domainname. This can +# happen for example if we receive DHCP domainname option. +# Default value is true. +# AllowDomainnameUpdates = true + # Keep only a single connected technology at any time. When a new # service is connected by the user or a better one is found according # to PreferredTechnologies, the new service is kept connected and all diff --git a/src/service.c b/src/service.c index bf8064a04e73..ab5b2c6aea19 100644 --- a/src/service.c +++ b/src/service.c @@ -1533,7 +1533,8 @@ static void default_changed(void) connman_setting_get_bool("AllowHostnameUpdates")) __connman_utsname_set_hostname(service->hostname); - if (service->domainname) + if (service->domainname && + connman_setting_get_bool("AllowDomainnameUpdates")) __connman_utsname_set_domainname(service->domainname); } ------------------------------ Message: 3 Date: Wed, 21 Feb 2018 06:40:22 +0000 From: Craig McQueen <craig.mcqu...@innerrange.com.au> To: "connman@lists.01.org" <connman@lists.01.org> Subject: ConnMan sometimes shutting down, sometimes not restarting Message-ID: <567973b516474c749843342f7c1f6...@innerrange.com.au> Content-Type: text/plain; charset="us-ascii" I'm using ConnMan in an ARM embedded Linux system (based on BeagleBone Black). For a long time, with systems using Linux kernel 3.14.x and 4.4.x, it has been working very well. Recently, I have done some work to upgrade to Linux kernel 4.9.x. With this kernel, ConnMan sometimes terminates and restarts shortly after start-up, something that I don't think it did before. At least, I think the change is related to the kernel upgrade. The system has also had other upgrades to other components, but the kernel update seems like the most likely cause. Examining recent system logs, I see this message appears shortly before a ConnMan restart: Jan 29 17:25:34 wt000043 daemon.err connmand[19746]: Inconsistent IP pool management (start not found) Shortly after that message, ConnMan shuts down. Usually it restarts, and everything is fine. But occasionally, ConnMan never restarts, and the system has no network connectivity. What might be a cause for this error? I see in the source code, function __connman_ippool_deladdr() contains: info = lookup_info(index, start); if (!info) { /* In theory this should never happen */ connman_error("Inconsistent IP pool management (start not found)"); return; } -- Craig McQueen ------------------------------ Message: 4 Date: Wed, 21 Feb 2018 11:11:14 +0200 From: Santtu Lakkala <i...@inz.fi> To: connman@lists.01.org Subject: [PATCH] firewall-iptables: Avoid string reallocation Message-ID: <20180221091114.23860-1-...@inz.fi> Use the format functionality of firewall_add_rule to avoid string duplication. Also avoids potential trouble if an address looking like a format string falls through. --- src/firewall-iptables.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/firewall-iptables.c b/src/firewall-iptables.c index 0fc98721..92f6c86b 100644 --- a/src/firewall-iptables.c +++ b/src/firewall-iptables.c @@ -391,14 +391,12 @@ int __connman_firewall_enable_nat(struct firewall_context *ctx, char *address, unsigned char prefixlen, char *interface) { - char *cmd; int err; - cmd = g_strdup_printf("-s %s/%d -o %s -j MASQUERADE", - address, prefixlen, interface); + firewall_add_rule(ctx, "nat", "POSTROUTING", + "-s %s/%d -o %s -j MASQUERADE", + address, prefixlen, interface); - firewall_add_rule(ctx, "nat", "POSTROUTING", cmd); - g_free(cmd); err = firewall_enable_rules(ctx); if (err) firewall_remove_rules(ctx); -- 2.16.1 ------------------------------ Message: 5 Date: Wed, 21 Feb 2018 12:08:30 +0200 From: Vasyl Vavrychuk <vvavryc...@gmail.com> To: Daniel Wagner <w...@monom.org> Cc: connman@lists.01.org Subject: Re: making Scan method asynchronous Message-ID: <cagj4m+6pnbwagybx-bqbajfqtvipdnlc4lvczppd+xxo2n_...@mail.gmail.com> Content-Type: text/plain; charset="UTF-8" How do you feel about adding ScanAsync method or Scan2 or P2PFind method that will behave asynchronously in the sense that it will return when scan or find successfully started? On Mon, Feb 19, 2018 at 6:58 PM, Daniel Wagner <w...@monom.org> wrote: > Hi Vasyl, > > On 02/13/2018 10:52 PM, Vasyl Vavrychuk wrote: >> >> I would like to make P2P_FIND_TIMEOUT large than 30 seconds locally. >> Potentially it can be very large value even infinite. >> >> But then connmanctl's 'scan p2p' command will timeout because connman >> client has 120 seconds D-Bus reply timeout. >> >> In my opinion it would be better if >> 1. Make Scan method being asynchronous in the sense it returns upon scan >> start. > > > The API documentation for p2p already reads as it could be asynchronous. > > In case of P2P technology, results will be signaled > via the PeersChanged signal from the manager > interface. > > Do you want to make Scan() completely asynchronous or just for p2p? I fear > we should not change the current Scan() behavior for any other technology > because it breaks the API. If the p2p folks would like to change that to > asynchronous I could be convinced to accept it. But it is ugly. > >> 2. Add Scanning property. That is what UI does, for example here >> >> http://git.merproject.org/mer-core/libconnman-qt/blob/master/plugin/technologymodel.h >> they manage their own m_scanning field. > > > Yes, that makes sense but as said above I fear we can't change Scan() > without breaking applications. This would be something for 2.x. > > Thanks, > Daniel ------------------------------ Subject: Digest Footer _______________________________________________ connman mailing list connman@lists.01.org https://lists.01.org/mailman/listinfo/connman ------------------------------ End of connman Digest, Vol 28, Issue 14 ***************************************