Send connman mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Re: [PATCH] nftables: Do no leak memory in error case
      (Daniel Wagner)
   2. Re: Spurious failures starting ConnMan with systemd
      (Robert Tiemann)
   3. Re: Spurious failures starting ConnMan with systemd
      (Daniel Wagner)
   4. Re: Spurious failures starting ConnMan with systemd (Patrik Flykt)
   5. [PATCH v3 0/7] IWD plugin (Daniel Wagner)
   6. [PATCH v3 1/7] service: Add support for IWD security type
      mapping (Daniel Wagner)
   7. [PATCH v3 2/7] iwd: Add infrastructure for iwd plugin
      (Daniel Wagner)


----------------------------------------------------------------------

Message: 1
Date: Tue, 15 Nov 2016 09:57:27 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Subject: Re: [PATCH] nftables: Do no leak memory in error case
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

On 11/12/2016 10:05 PM, Daniel Wagner wrote:
> From: Daniel Wagner <[email protected]>
>
> mnl_nlmsg_batch_start() allocated memory which needs be freed by
> mnl_nlmsg_batch_stop().

applied after s/allocated/allocates/ fix.


------------------------------

Message: 2
Date: Tue, 15 Nov 2016 10:45:25 +0100
From: Robert Tiemann <[email protected]>
To: Patrik Flykt <[email protected]>, Daniel Wagner
        <[email protected]>, [email protected]
Subject: Re: Spurious failures starting ConnMan with systemd
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi!

On 11/14/2016 01:30 PM, Patrik Flykt wrote:
> On Fri, 2016-11-11 at 12:04 +0100, Daniel Wagner wrote:
>>
>> I am no systemd expert. I just did a quick read in the documentation
>> and
>> it seems it is recommended to have After= and Requires= together:

Yes, this seems to be required here.

>> Care to send a patch which adds Requires=? Please include your
>> excellent error report into the commit message.

I can create a patch that adds Requires=dbus.service to the service
file if you like, but please read my comments below.

> Hmm, then again man systemd.service says that "...Service units with
> this option configured implicitly gain dependencies on the dbus.socket
> unit. This type is the default if BusName= is specified..."
>
> ConnMan defines both Type=dbus and Busname=net.connman, so it should
> already have these dependencies. Unless the DefaultDependencies=false
> overrides this behavior. Do we have any systemd experts around?

I am by no means a systemd expert, so instead I've tried a few things.
The output of

     $ systemctl show connman.service

with the service file from v1.33 installed does not show any
dependencies on dbus.socket, but only an After= dependency on
dbus.service. The only Requires= dependency is on -.mount (and then
there is also the RequiredMountsFor= dependency). I always thought
this should be enough because dbus.service is actually required by
other services in the system, therefore ConnMan should be started
*after* it, right?

Well. As I've come to realize, the troubles started after an upgrade
of ConnMan v1.30 to v1.33 a few weeks ago. So, I've checked the
changes of connman.service.in.

With the service file shipped with v1.30, the output of the above
command shows Requires=basic.target, which depends on sockets.target,
which depends on dbus.socket. I think that's why I didn't have any
trouble with v1.30.

In 09aa024 (first change to the service file after v1.30 release),
DefaultDependencies was set to false. According to
https://www.freedesktop.org/software/systemd/man/systemd.special.html,
an After= dependency on basic.target is added automatically if
DefaultDependencies is set to yes, so this is missing now. The After=
dependency on dbus.service is still there, but it is not Required. Out
of curiosity, I've removed the dbus.service dependency completely to
check if Type=dbus is enough as is documented. Turns out it is not.
Neither the output of "systemctl show connman.service" nor that of
"systemctl list-dependencies connman.service" show _any_ dependencies
on dbus.service/dbus.socket in this case.

Why the automatically added After= dependency on basic.target has
turned into a Requires= dependency with the v1.30 file, but the
explicit After=dbus.service dependency in the file from 09aa024
remains an After= dependency is beyond me. My guess is that
DefaultDependencies does a little bit more than is documented, or
maybe it's just a bug in my version of systemd (v225). Maybe it's some
strange interaction between unit files that I am unable to see.

A comment from someone with a little more experience with systemd
would be most welcome.

> Cheers,
>
>       Patrik

Kind regards,
Robert


------------------------------

Message: 3
Date: Tue, 15 Nov 2016 11:59:47 +0100
From: Daniel Wagner <[email protected]>
To: Robert Tiemann <[email protected]>
Cc: Patrik Flykt <[email protected]>, [email protected],
        [email protected]
Subject: Re: Spurious failures starting ConnMan with systemd
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

[Cc: systemd mailing list"

what happened until now
"""
I am working on a system based on Yocto Project which uses ConnMan
v1.33 for network management. The system uses systemd and generally
works well so far, but once in a blue moon ConnMan fails to start up.
Here is the relevant log from systemd:

[   15.886270] systemd[1]: connman.service: Main process exited, 
code=exited, status=1/FAILURE
[   15.912838] systemd[1]: Failed to start Connection service.

There were no logs from connmand in this case, so in the
connman.service file I've added the -d option to ExecStart= and set
StandardOutput to syslog. I have restarted the system many times until
the failure occurred again. There is only a single line from connmand
in the log:

[   12.174528] connmand[278]: Failed to connect to socket 
/var/run/dbus/system_bus_socket: No such file or directory
[   12.209448] systemd[1]: connman.service: Main process exited, 
code=exited, status=1/FAILURE
[   12.242872] systemd[1]: Failed to start Connection service.

So the system D-Bus is not up and running the time ConnMan is started.
In case of failure, I've noticed there is also no mentioning about
D-Bus starting up in the log, but in all other logs there is.

Now, I think the After=dbus.service line in src/connman.service.in is
not enough because After= specifies order, but not a requirement
dependency. This what Requires= is there for. I've added the line

     Requires=dbus.service

to the service file, reverted my other changes, and tried again. I've
been unable to reproduce the problem ever since, so for me the problem
seems to be fixed.

What do you think? Should src/connman.service.in be changed to include
the Requires= line by default or is this something to be fixed
somewhere else?

Should network-pre.target and systemd-sysusers.service be added to
Requires= as well?
"""
]

On 11/15/2016 10:45 AM, Robert Tiemann wrote:
> On 11/14/2016 01:30 PM, Patrik Flykt wrote:
>> On Fri, 2016-11-11 at 12:04 +0100, Daniel Wagner wrote:
>>>
>>> I am no systemd expert. I just did a quick read in the documentation
>>> and
>>> it seems it is recommended to have After= and Requires= together:
>
> Yes, this seems to be required here.
>
>>> Care to send a patch which adds Requires=? Please include your
>>> excellent error report into the commit message.
>
> I can create a patch that adds Requires=dbus.service to the service
> file if you like, but please read my comments below.
>
>> Hmm, then again man systemd.service says that "...Service units with
>> this option configured implicitly gain dependencies on the dbus.socket
>> unit. This type is the default if BusName= is specified..."
>>
>> ConnMan defines both Type=dbus and Busname=net.connman, so it should
>> already have these dependencies. Unless the DefaultDependencies=false
>> overrides this behavior. Do we have any systemd experts around?
>
> I am by no means a systemd expert, so instead I've tried a few things.
> The output of
>
>     $ systemctl show connman.service
>
> with the service file from v1.33 installed does not show any
> dependencies on dbus.socket, but only an After= dependency on
> dbus.service. The only Requires= dependency is on -.mount (and then
> there is also the RequiredMountsFor= dependency). I always thought
> this should be enough because dbus.service is actually required by
> other services in the system, therefore ConnMan should be started
> *after* it, right?
>
> Well. As I've come to realize, the troubles started after an upgrade
> of ConnMan v1.30 to v1.33 a few weeks ago. So, I've checked the
> changes of connman.service.in.
>
> With the service file shipped with v1.30, the output of the above
> command shows Requires=basic.target, which depends on sockets.target,
> which depends on dbus.socket. I think that's why I didn't have any
> trouble with v1.30.
>
> In 09aa024 (first change to the service file after v1.30 release),
> DefaultDependencies was set to false. According to
> https://www.freedesktop.org/software/systemd/man/systemd.special.html,
> an After= dependency on basic.target is added automatically if
> DefaultDependencies is set to yes, so this is missing now. The After=
> dependency on dbus.service is still there, but it is not Required. Out
> of curiosity, I've removed the dbus.service dependency completely to
> check if Type=dbus is enough as is documented. Turns out it is not.
> Neither the output of "systemctl show connman.service" nor that of
> "systemctl list-dependencies connman.service" show _any_ dependencies
> on dbus.service/dbus.socket in this case.
>
> Why the automatically added After= dependency on basic.target has
> turned into a Requires= dependency with the v1.30 file, but the
> explicit After=dbus.service dependency in the file from 09aa024
> remains an After= dependency is beyond me. My guess is that
> DefaultDependencies does a little bit more than is documented, or
> maybe it's just a bug in my version of systemd (v225). Maybe it's some
> strange interaction between unit files that I am unable to see.
>
> A comment from someone with a little more experience with systemd
> would be most welcome.

Any recommendation from systemd folks?

cheers,
daniel


------------------------------

Message: 4
Date: Tue, 15 Nov 2016 15:30:37 +0200
From: Patrik Flykt <[email protected]>
To: Robert Tiemann <[email protected]>, Daniel Wagner <[email protected]>,
        [email protected]
Subject: Re: Spurious failures starting ConnMan with systemd
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Tue, 2016-11-15 at 10:45 +0100, Robert Tiemann wrote:
> In 09aa024 (first change to the service file after v1.30 release),
> DefaultDependencies was set to false. According to
> https://www.freedesktop.org/software/systemd/man/systemd.special.html
> ,
> an After= dependency on basic.target is added automatically if
> DefaultDependencies is set to yes, so this is missing now. The After=
> dependency on dbus.service is still there, but it is not Required.
> Out of curiosity, I've removed the dbus.service dependency completely
> to check if Type=dbus is enough as is documented. Turns out it is
> not. Neither the output of "systemctl show connman.service" nor that
> of "systemctl list-dependencies connman.service" show _any_
> dependencies on dbus.service/dbus.socket in this case.

This probably just means that with DefaultDependencies set to no,
*none* of the automatic dependencies are honored. And the dependency on
basic.target was the one apparently dragging in dbus.service. ConnMan
needs to run with DefaultDependencies set to no, as it is the one
contributing to network.target which is happening before basic.target.

> Why the automatically added After= dependency on basic.target has
> turned into a Requires= dependency with the v1.30 file, but the
> explicit After=dbus.service dependency in the file from 09aa024
> remains an After= dependency is beyond me. My guess is that
> DefaultDependencies does a little bit more than is documented, or
> maybe it's just a bug in my version of systemd (v225). Maybe it's
> some strange interaction between unit files that I am unable to see.

Probably basic.target is something that is reached no matter what, but
an After=dbus.service is not. In my system I see an additional
dependency only on dbus.socket, and all works fine. This with systemd
231 and Debian.


Cheers,

        Patrik


------------------------------

Message: 5
Date: Tue, 15 Nov 2016 14:58:41 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [PATCH v3 0/7] IWD plugin
Message-ID: <[email protected]>

From: Daniel Wagner <[email protected]>

Addressed Patrik's comments. If no one complains soon I am going
to apply it.

Thanks,
Daniel

changes from v2:
  - disable plugin on default
  - added README entry for plugin
  - added comment on agent cancel request
  - droped passwd bits from agent patch and moved it to
    networking one

changes from v1:
  - move memory leaks fixed: un/ref devices
  - remove all network when device goes away
  - all objects live time is bounded to d-bus live time

changes from v0:
  - addressed feedback from Denis (property changed)
  - fixed a couple of memory overwrites due to wrong ref/unref
  - dropped tethering bits (not implemented)
  - handling of signal strength

Daniel Wagner (7):
  service: Add support for IWD security type mapping
  iwd: Add infrastructure for iwd plugin
  iwd: Track D-Bus API
  iwd: Add Agent support
  iwd: Register technology, device and network driver stub
  iwd: Add/remove ConnMan devices
  iwd: Add/remove ConnMan networks

 Makefile.plugins |    5 +
 README           |    9 +
 configure.ac     |    5 +
 plugins/iwd.c    | 1110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/service.c    |    4 +-
 5 files changed, 1131 insertions(+), 2 deletions(-)
 create mode 100644 plugins/iwd.c

-- 
2.7.4


------------------------------

Message: 6
Date: Tue, 15 Nov 2016 14:58:42 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [PATCH v3 1/7] service: Add support for IWD security type
        mapping
Message-ID: <[email protected]>

From: Daniel Wagner <[email protected]>

IWD names the security types slightly different to what
gsupplicant returns. Though we need to map them to those names
because ConnMan exposes these strings via the Service.Security
property.
---
 src/service.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/service.c b/src/service.c
index 5304c0db72bd..40e117d5dd35 100644
--- a/src/service.c
+++ b/src/service.c
@@ -241,9 +241,9 @@ enum connman_service_security 
__connman_service_string2security(const char *str)
 
        if (!strcmp(str, "psk"))
                return CONNMAN_SERVICE_SECURITY_PSK;
-       if (!strcmp(str, "ieee8021x"))
+       if (!strcmp(str, "ieee8021x") || !strcmp(str, "8021x"))
                return CONNMAN_SERVICE_SECURITY_8021X;
-       if (!strcmp(str, "none"))
+       if (!strcmp(str, "none") || !strcmp(str, "open"))
                return CONNMAN_SERVICE_SECURITY_NONE;
        if (!strcmp(str, "wep"))
                return CONNMAN_SERVICE_SECURITY_WEP;
-- 
2.7.4


------------------------------

Message: 7
Date: Tue, 15 Nov 2016 14:58:43 +0100
From: Daniel Wagner <[email protected]>
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Subject: [PATCH v3 2/7] iwd: Add infrastructure for iwd plugin
Message-ID: <[email protected]>

From: Daniel Wagner <[email protected]>

The plugin is disabled by default. The upstream project hasn't released
any version so far.
---
 Makefile.plugins |  5 +++++
 README           |  9 +++++++++
 configure.ac     |  5 +++++
 plugins/iwd.c    | 39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 58 insertions(+)
 create mode 100644 plugins/iwd.c

diff --git a/Makefile.plugins b/Makefile.plugins
index b01fd808d481..dce8b2834a4d 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -26,6 +26,11 @@ builtin_modules += wifi
 builtin_sources += plugins/wifi.c $(gsupplicant_sources)
 endif
 
+if IWD
+builtin_modules += iwd
+builtin_sources += plugins/iwd.c
+endif
+
 if BLUETOOTH
 builtin_modules += bluetooth
 builtin_sources += plugins/bluetooth.c
diff --git a/README b/README
index 531f396f8e93..f4d189513b72 100644
--- a/README
+++ b/README
@@ -131,6 +131,15 @@ Configuration and options
                detected and only a runtime dependency. It is not needed to
                build ConnMan.
 
+       --enable-iwd
+
+               Enable support for Wireless daemon for Linux
+
+               The IWD project does not have initial release so far,
+               therefore by default IWD support is not enabled.
+
+               It is safe to enable this option along WiFi support.
+
        --disable-pacrunner
 
                Disable support for PACrunner proxy handling
diff --git a/configure.ac b/configure.ac
index b477aa1682cb..86e8b40e486c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -340,6 +340,11 @@ AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
                                        [enable_wifi=${enableval}])
 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
 
+AC_ARG_ENABLE(iwd, AC_HELP_STRING([--enable-iwd],
+                               [enable iwd support]),
+                                       [enable_iwd=${enableval}])
+AM_CONDITIONAL(IWD, test "${enable_iwd}" = "yes")
+
 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
                                [disable Bluetooth support]),
                                        [enable_bluetooth=${enableval}])
diff --git a/plugins/iwd.c b/plugins/iwd.c
new file mode 100644
index 000000000000..d42f21a2281e
--- /dev/null
+++ b/plugins/iwd.c
@@ -0,0 +1,39 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2016  BMW Car IT GmbH.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define CONNMAN_API_SUBJECT_TO_CHANGE
+#include <connman/plugin.h>
+
+static int iwd_init(void)
+{
+       return 0;
+}
+
+static void iwd_exit(void)
+{
+}
+
+CONNMAN_PLUGIN_DEFINE(iwd, "IWD plugin", VERSION,
+               CONNMAN_PLUGIN_PRIORITY_DEFAULT, iwd_init, iwd_exit)
-- 
2.7.4


------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 13, Issue 22
***************************************

Reply via email to