[PATCH v5 0/4] Add AlwaysConnectedTechnologies feature
by Ioan-Adrian Ratiu
Changes since v4 (Based on Daniel's feedback):
* Converted the always_connect function to an array to
maintain consistency with the way the similar active_session
array works.
Ioan-Adrian Ratiu (4):
main: add new AlwaysConnectedTechnologies list option
service: implement AlwaysConnectedTechnologies option
service: abstract the more complex autoconnect conditionals
main.conf: document AlwaysConnectedTechnologies option
doc/connman.conf.5.in | 6 ++++++
src/main.c | 18 ++++++++++++++++++
src/main.conf | 7 +++++++
src/service.c | 48 ++++++++++++++++++++++++++++++++++++++++++++----
4 files changed, 75 insertions(+), 4 deletions(-)
--
2.10.2
4 years, 2 months
[PATCH v1 0/7] Too many DBG() on default
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
This series drops a bunch of very noisy DBGs. None of them
really adds a real value except the dnsproxy ones. For those
I decided to follow the pattern I found in gdhcp and gweb.
I converted most of the DBGs to debug and defined it as empty
macro. That allows anyone hacking on dnsproxy to get some
inside.
With all patches applied I am able to see again whats happening
without spammed away.
cheers,
daniel
Daniel Wagner (7):
service: Remove noisy DBGs
ipconfig: Remove noisy DBGs
dnsproxy: Disable noisy DBGs
storage: Remove noisy DBG
network: Remove noisy DBGs and merge one
wispr: Merge two DBGs into one
rtnl: Remove useless DBG
src/dnsproxy.c | 154 +++++++++++++++++++++++++++++----------------------------
src/ipconfig.c | 34 +------------
src/network.c | 24 +--------
src/rtnl.c | 2 -
src/service.c | 8 +--
src/storage.c | 2 -
src/wispr.c | 4 +-
7 files changed, 85 insertions(+), 143 deletions(-)
--
2.7.4
4 years, 2 months
Connmanctl not able to connect via WPS_PIN entry
by Kandiga, Harish
Hi,
I am trying to use connmanctl to connect via WPS_PIN entry. Latest git code is not able to connect. ( pushbutton works though)
Logs:
connmanctl> agent on
Agent registered
connmanctl> connect wifi_0016ea684dcc_496e7370697265_managed_psk
Agent RequestInput wifi_0016ea684dcc_496e7370697265_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory, Alternates=[ WPS ] ]
WPS = [ Type=wpspin, Requirement=alternate ]
Passphrase?
WPS PIN (empty line for pushbutton)? 12345678
Agent ReportError wifi_0016ea684dcc_496e7370697265_managed_psk
connect-failed
Agent request cancelled by ConnMan
Error /net/connman/service/wifi_0016ea684dcc_496e7370697265_managed_psk: Operation aborted
connmanctl>
Can anyone please inform if this is not yet implemented properly in connman?
Thanks,
Harish
4 years, 2 months
[PATCH v3 0/7] IWD plugin
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
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
4 years, 2 months
[RFC 0/4] Too many DBG() on default
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
Hi,
When turning on the debug option '-d *' the amount of output is just
too much too see what's happening. Especially the dnsproxy code is
very verbose.
There are the ones we should just remove e.g.
connmand[16807]: src/service.c:get_properties() service 0x1c72b40
connmand[16807]: src/ipconfig.c:__connman_ipconfig_append_ipv4config()
connmand[16807]: src/ipconfig.c:__connman_ipconfig_append_ipv6config()
connmand[16807]: src/service.c:get_properties() service 0x1c72b40
connmand[16807]: src/ipconfig.c:__connman_ipconfig_append_ipv4config()
connmand[16807]: src/ipconfig.c:__connman_ipconfig_append_ipv6config()
[...]
And there the ones which do make sense too keep, e.g. the dnsproxy for
low level debugging.
connmand[16807]: src/dnsproxy.c:ns_resolv() cache hit sync-313-us-west-2.sync.services.mozilla.com. type AAAA
connmand[16807]: src/dnsproxy.c:forward_dns_reply() Received 146 bytes (id 0x015a)
connmand[16807]: src/dnsproxy.c:forward_dns_reply() req 0x1c81210 dstid 0x015a altid 0x58e0 rcode 0
connmand[16807]: src/dnsproxy.c:cache_update() offset 0 hdr 0x7ffc1cfb0af0 msg 0x7ffc1cfb0af0 rcode 0
connmand[16807]: src/dnsproxy.c:parse_response() qr 1 qdcount 1
connmand[16807]: src/dnsproxy.c:forward_dns_reply() proto 17 sent 146 bytes to 13
connmand[16807]: src/dnsproxy.c:forward_dns_reply() Received 146 bytes (id 0x015a)
connmand[16807]: src/dnsproxy.c:udp_listener_event() Received 37 bytes (id 0x7bb2)
c
I did a quick hack to get a discussion going on the idea to support
debug levels? What do you think on this?
Or should I just do the same with dnsproxy as we have with these here:
README: CONNMAN_DHCP_DEBUG DHCPv4 related debug information
README: CONNMAN_DHCPV6_DEBUG DHCPv6 related debug information
README: CONNMAN_IPTABLES_DEBUG Extra information when iptables is used
README: CONNMAN_RESOLV_DEBUG Name resolver debug prints. These debug prints
README: CONNMAN_SUPPLICANT_DEBUG Debugging prints for communication between
README: CONNMAN_WEB_DEBUG Debug information when ConnMan does Internet
Having two ways to enable verbose debugging is confusing IMO. But
then, I don't care too much as long the amount of the default debug
output goes down. It's really hard to find anything useful these days.
cheers,
daniel
Daniel Wagner (3):
log: Remove unused CONNMAN_DEBUG_FLAG_ALIAS
log: Count number of -d options invokation
dnsproxy: Turn normal DBG to verbose DBG to reduce noise
Slava Monich (1):
main: Make -d option repeatable
include/log.h | 18 +++---
src/dnsproxy.c | 192 ++++++++++++++++++++++++++++-----------------------------
src/log.c | 10 +--
src/main.c | 13 +++-
4 files changed, 117 insertions(+), 116 deletions(-)
--
2.7.4
4 years, 2 months
Spurious failures starting ConnMan with systemd
by Robert Tiemann
Hi,
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?
Kind regards,
Robert
4 years, 2 months
Re: Spurious failures starting ConnMan with systemd
by Daniel Wagner
Hi Colin,
On 11/15/2016 03:46 PM, Colin Guthrie wrote:
> Hope you're keeping well?
Doing fine! How is live in the north?
> So, by default, dbus should be socket activated. That means that when
> dbus.service eventually starts shouldn't really matter, provided it is
> eventually started. This is because it's actually dbus.socket that's the
> important unit. It should be started by sockets.target which is pulled
> in as part of the default dependencies that all units get automatically
> (provided they've not disabled this)
Okay, that makes sense.
> So, check for dbus.socket, and check that connman.service doesn't
> disable default deps.
I think we do, see below.
> If socket activation is used, then there shouldn't be any need to
> mention dbus.socket/service in connman.service at all.
"""
[Unit]
Description=Connection service
DefaultDependencies=false
Conflicts=shutdown.target
RequiresMountsFor=/var/lib/connman
After=dbus.service network-pre.target systemd-sysusers.service
Before=network.target multi-user.target shutdown.target
Wants=network.target
[Service]
Type=dbus
BusName=net.connman
Restart=on-failure
ExecStart=/usr/sbin/connmand -n
StandardOutput=null
CapabilityBoundingSet=CAP_KILL CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SYS_TIME CAP_SYS_MODULE
ProtectHome=true
ProtectSystem=full
[Install]
WantedBy=multi-user.target
"""
Okay, so the DefaultDependencies=false is causing this problem then.
In our commit history I found following explanation for it:
"""
commit 09aa0243aac40ec4e5bd0fbe41e702be4952a382
Author: Patrik Flykt <patrik.flykt(a)linux.intel.com>
Date: Thu Sep 17 10:42:46 2015 +0300
connman.service: Fix dependencies for early boot
Unset default dependencies in order to properly run at early boot and
require the save directory to be mounted before starting.
See the systemd.unit man page, Debian's wiki page
https://wiki.debian.org/Teams/pkg-systemd/rcSMigration and the upstream
systemd-networkd.service file for details.
diff --git a/src/connman.service.in b/src/connman.service.in
index 8f7f3429f7dc..0a8f15c9f90b 100644
--- a/src/connman.service.in
+++ b/src/connman.service.in
@@ -1,7 +1,10 @@
[Unit]
Description=Connection service
+DefaultDependencies=false
+Conflicts=shutdown.target
+RequiresMountsFor=@localstatedir@/lib/connman
After=dbus.service network-pre.target
-Before=network.target remote-fs-pre.target
+Before=network.target shutdown.target remote-fs-pre.target
Wants=network.target remote-fs-pre.target
[Service]
"""
Hmm, now I am confused...
Thanks,
Daniel
4 years, 2 months
[PATCH] nftables: Do no leak memory in error case
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
mnl_nlmsg_batch_start() allocated memory which needs be freed by
mnl_nlmsg_batch_stop().
---
src/firewall-nftables.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/firewall-nftables.c b/src/firewall-nftables.c
index d36e90b657be..4d47f20097ec 100644
--- a/src/firewall-nftables.c
+++ b/src/firewall-nftables.c
@@ -418,12 +418,9 @@ static int table_cmd(struct mnl_socket *nl, struct nftnl_table *t,
/* The current table commands do not support any callback returns. */
err = send_and_dispatch(nl, mnl_nlmsg_batch_head(batch),
mnl_nlmsg_batch_size(batch), 0, NULL);
- if (err < 0)
- return err;
mnl_nlmsg_batch_stop(batch);
-
- return 0;
+ return err;
}
static int chain_cmd(struct mnl_socket *nl, struct nftnl_chain *chain,
@@ -451,12 +448,9 @@ static int chain_cmd(struct mnl_socket *nl, struct nftnl_chain *chain,
err = send_and_dispatch(nl, mnl_nlmsg_batch_head(batch),
mnl_nlmsg_batch_size(batch), cb_type, cb_val);
- if (err < 0)
- return err;
mnl_nlmsg_batch_stop(batch);
-
- return 0;
+ return err;
}
static int rule_cmd(struct mnl_socket *nl, struct nftnl_rule *rule,
--
2.7.4
4 years, 2 months
[PATCH v4 0/4] Add AlwaysConnectedTechnologies feature
by Ioan-Adrian Ratiu
Changes since v3 (based on Daniel's feedback):
* Updated manpage to document the new main.conf option
* Fixed a typo in the last condition modified in auto_connect_service
(added a negation to the always_connect call)
* Split the more complex auto_connect_service conditionals into their
own function and added comments to make them easier to understand
* Minor whitespace cleanups
Ioan-Adrian Ratiu (4):
main: add new AlwaysConnectedTechnologies list option
service: implement AlwaysConnectedTechnologies option
service: abstract the more complex autoconnect conditionals
main.conf: document AlwaysConnectedTechnologies option
doc/connman.conf.5.in | 6 ++++++
src/main.c | 18 ++++++++++++++++++
src/main.conf | 7 +++++++
src/service.c | 49 +++++++++++++++++++++++++++++++++++++++++++++----
4 files changed, 76 insertions(+), 4 deletions(-)
--
2.10.2
4 years, 2 months