[PATCH v2 0/7] IWD plugin
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
This version passes heavy stress testing without leaking memory or
crashing. So far so good. I still seem to have problems to get a
working setup with iwd. For example when I connect to a network
sometimes it works without a problem but most of the time iwd just
disconnects immediallty. It looks like a problem with the interaction
between iwd and the hardware. I get different behavior depending on
the WiFi hardware.
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 +
configure.ac | 5 +
plugins/iwd.c | 1104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/service.c | 4 +-
4 files changed, 1116 insertions(+), 2 deletions(-)
create mode 100644 plugins/iwd.c
--
2.7.4
4 years, 2 months
[PATCH v1 0/7] IWD plugin
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
Hi,
This version should be okay to get things rolling. Fixed a couple
of memory overwrites due to wrong ref/unref. I removed also the
things which didn't do anything useful (like tethering).
WPS and tetherning support is missing. I am running out of time
to work on this in the next few weeks. Please give it a try
and see and report problems.
cheers,
daniel
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 +
configure.ac | 5 +
plugins/iwd.c | 1101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/service.c | 4 +-
4 files changed, 1113 insertions(+), 2 deletions(-)
create mode 100644 plugins/iwd.c
--
2.7.4
4 years, 2 months
[PATCH v2] service: Update nameservers automatically
by Patrik Flykt
Automatically update nameserver information when they are appended
or removed to the resolver code so that nameservers for IPv6 can be
signalled after IPv4 has moved the service to state 'ready'. Create
a zero second timeout so that nameservers can be appended or removed
in a loop one by one with only one D-Bus PropertyChanged signal
being sent.
Verify that the service is either connected or the nameservers have
been removed when the service is inactive before sending the
PropertyChanged signal.
---
v2: Move nameserver announcing to the updating of the resolver. This
should take care of adding IPv6 nameservers after the service is
in state 'ready'.
Please test,
Patrik
src/service.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 62 insertions(+), 6 deletions(-)
diff --git a/src/service.c b/src/service.c
index f6a76f6..1d65410 100644
--- a/src/service.c
+++ b/src/service.c
@@ -92,6 +92,7 @@ struct connman_service {
char **nameservers;
char **nameservers_config;
char **nameservers_auto;
+ int nameservers_timeout;
char **domains;
char *hostname;
char *domainname;
@@ -133,6 +134,7 @@ static struct connman_ipconfig *create_ip4config(struct connman_service *service
int index, enum connman_ipconfig_method method);
static struct connman_ipconfig *create_ip6config(struct connman_service *service,
int index);
+static void dns_changed(struct connman_service *service);
struct find_data {
const char *path;
@@ -922,6 +924,24 @@ static bool is_connected_state(const struct connman_service *service,
return false;
}
+static bool is_idle(struct connman_service *service)
+{
+ switch (service->state) {
+ case CONNMAN_SERVICE_STATE_IDLE:
+ case CONNMAN_SERVICE_STATE_DISCONNECT:
+ case CONNMAN_SERVICE_STATE_FAILURE:
+ return true;
+ case CONNMAN_SERVICE_STATE_UNKNOWN:
+ case CONNMAN_SERVICE_STATE_ASSOCIATION:
+ case CONNMAN_SERVICE_STATE_CONFIGURATION:
+ case CONNMAN_SERVICE_STATE_READY:
+ case CONNMAN_SERVICE_STATE_ONLINE:
+ break;
+ }
+
+ return false;
+}
+
static bool is_connecting(struct connman_service *service)
{
return is_connecting_state(service, service->state);
@@ -932,6 +952,29 @@ static bool is_connected(struct connman_service *service)
return is_connected_state(service, service->state);
}
+
+static int nameservers_changed_cb(void *user_data)
+{
+ struct connman_service *service = user_data;
+
+ DBG("service %p", service);
+
+ service->nameservers_timeout = 0;
+ if ((is_idle(service) && !service->nameservers) ||
+ is_connected(service))
+ dns_changed(service);
+
+ return FALSE;
+}
+
+static void nameservers_changed(struct connman_service *service)
+{
+ if (!service->nameservers_timeout)
+ service->nameservers_timeout = g_timeout_add_seconds(0,
+ nameservers_changed_cb,
+ service);
+}
+
static bool nameserver_available(struct connman_service *service,
enum connman_ipconfig_type type,
const char *ns)
@@ -1011,7 +1054,7 @@ static int nameserver_add(struct connman_service *service,
enum connman_ipconfig_type type,
const char *nameserver)
{
- int index;
+ int index, ret;
if (!nameserver_available(service, type, nameserver))
return 0;
@@ -1020,7 +1063,11 @@ static int nameserver_add(struct connman_service *service,
if (index < 0)
return -ENXIO;
- return connman_resolver_append(index, NULL, nameserver);
+ ret = connman_resolver_append(index, NULL, nameserver);
+ if (ret >= 0)
+ nameservers_changed(service);
+
+ return ret;
}
static int nameserver_add_all(struct connman_service *service,
@@ -1054,7 +1101,7 @@ static int nameserver_remove(struct connman_service *service,
enum connman_ipconfig_type type,
const char *nameserver)
{
- int index;
+ int index, ret;
if (!nameserver_available(service, type, nameserver))
return 0;
@@ -1063,7 +1110,11 @@ static int nameserver_remove(struct connman_service *service,
if (index < 0)
return -ENXIO;
- return connman_resolver_remove(index, NULL, nameserver);
+ ret = connman_resolver_remove(index, NULL, nameserver);
+ if (ret >= 0)
+ nameservers_changed(service);
+
+ return ret;
}
static int nameserver_remove_all(struct connman_service *service,
@@ -1139,6 +1190,8 @@ int __connman_service_nameserver_append(struct connman_service *service,
nameserver_add(service, CONNMAN_IPCONFIG_TYPE_ALL, nameserver);
}
+ nameservers_changed(service);
+
searchdomain_add_all(service);
return 0;
@@ -4500,6 +4553,11 @@ static void service_free(gpointer user_data)
reply_pending(service, ENOENT);
+ if (service->nameservers_timeout) {
+ g_source_remove(service->nameservers_timeout);
+ dns_changed(service);
+ }
+
__connman_notifier_service_remove(service);
service_schedule_removed(service);
@@ -5440,7 +5498,6 @@ static int service_indicate_state(struct connman_service *service)
g_get_current_time(&service->modified);
service_save(service);
- dns_changed(service);
domain_changed(service);
proxy_changed(service);
@@ -5481,7 +5538,6 @@ static int service_indicate_state(struct connman_service *service)
__connman_wpad_stop(service);
- dns_changed(service);
domain_changed(service);
proxy_changed(service);
--
2.10.1
4 years, 2 months
Support fro strongswan in Connman
by Florent Le Saout
Hi,
I'm using Strongswan for IPsec and connman as network manager.
It seems that there is no support for strongswan in Connman ?
If so then is there any plan to integrate it at some point, or any work
on that already ongoing ?
Thanks,
Florent.
4 years, 2 months
[RFC v0 00/10] IWD plugin
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
A first rough version for testing. There are still a few open question
or misbehave but generally it should be usable.
patch 1: Makes service a bit more silent
patch 2: Fixes a small bug where we block ourself in D-Bus
message processing
patch 3-8: Add basic infrastructre for the plugin and then add
piece by piece relevant code
patch 9: Start of tethering support WIP
cheers,
daniel
Daniel Wagner (10):
service: Remove noisy DBGs
service: Connect() should not block
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
iwd: Add tethering support
Makefile.plugins | 5 +
configure.ac | 5 +
plugins/iwd.c | 1116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/service.c | 14 +-
4 files changed, 1130 insertions(+), 10 deletions(-)
create mode 100644 plugins/iwd.c
--
2.7.4
4 years, 2 months
[PATCH v3 0/3] Add AlwaysConnectedTechnologies feature
by Ioan-Adrian Ratiu
Hello
Thank you for the great feedback and sorry for the long delay,
I was swamped with other work but now I'm back on this series.
Changes since v2 (based on Patrik's feedback):
* Split the bigger patch into a 3 smaller patch series
* service.c: renamed the newly added function to always_connect()
and made it static
* Added some more conditions testing always_connect() in
auto_connect_service()
Ioan-Adrian Ratiu (3):
main: add new AlwaysConnectedTechnologies list option
service: Implement AlwaysConnectedTechnologies
main.conf: document AlwaysConnectedTechnologies option
src/main.c | 18 ++++++++++++++++++
src/main.conf | 7 +++++++
src/service.c | 24 ++++++++++++++++++++----
3 files changed, 45 insertions(+), 4 deletions(-)
--
2.10.2
4 years, 2 months
[PATCH] ntp: clear ADJ_MAXERROR to keep STA_UNSYNC cleared after jump adjust
by Alexander Kochetkov
NTP use jump adjust if system has incorrect time read from RTC during boot.
It is desireble to update RTC time as soon as NTP set correct system time.
Sometimes kernel failed to update RTC due to STA_UNSYNC get set before RTC
update finised. In that case RTC time wouldn't be updated within long time.
The commit makes RTC updates stable.
When NTP do jump time adjust using ADJ_SETOFFSET it clears STA_UNSYNC flag.
If don't clear ADJ_MAXERROR, STA_UNSYNC will be set again by kernel within
1 second (by second_overflow() function). STA_UNSYNC flag prevent RTC updates
in kernel. Sometimes the kernel is able to update RTC withing 1 second,
but sometimes it falied.
---
src/ntp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/ntp.c b/src/ntp.c
index 7e66c9b..0e80c3e 100644
--- a/src/ntp.c
+++ b/src/ntp.c
@@ -351,11 +351,13 @@ static void decode_msg(void *base, size_t len, struct timeval *tv,
connman_info("ntp: adjust (slew): %+.6f sec", offset);
} else {
- tmx.modes = ADJ_STATUS | ADJ_NANO | ADJ_SETOFFSET;
+ tmx.modes = ADJ_STATUS | ADJ_NANO | ADJ_SETOFFSET | ADJ_MAXERROR | ADJ_ESTERROR;
/* ADJ_NANO uses nanoseconds in the microseconds field */
tmx.time.tv_sec = (long)offset;
tmx.time.tv_usec = (offset - tmx.time.tv_sec) * NSEC_PER_SEC;
+ tmx.maxerror = 0;
+ tmx.esterror = 0;
/* the kernel expects -0.3s as {-1, 7000.000.000} */
if (tmx.time.tv_usec < 0) {
--
1.7.9.5
4 years, 2 months
[PATCH] provider: Remove unnecessary condition check
by Saurav Babu
---
src/provider.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/provider.c b/src/provider.c
index 0726f4a..9c71a20 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -141,12 +141,8 @@ int connman_provider_disconnect(struct connman_provider *provider)
provider_indicate_state(provider,
CONNMAN_SERVICE_STATE_DISCONNECT);
- if (err < 0) {
- if (err != -EINPROGRESS)
- return err;
-
- return -EINPROGRESS;
- }
+ if (err < 0)
+ return err;
if (provider->vpn_service)
provider_indicate_state(provider,
--
1.9.1
4 years, 2 months
[PATCH] service: Disconnect old service only when connecting new service
by Saurav Babu
In the following scenario:
1. Device is connected to AP in non hidden mode.
2. Connection is initated to AP in hidden mode.
connman disconnects old service and tries to connect to new service. But
for connecting hidden service it first scans the hidden AP and when
network is added for hidden AP then connection is tried. In the meantime
normal AP got disconnected and was tried to autoconnect even before
hidden AP was scanned successfully.
Ideally non hidden AP should only be disconnected when hidden AP is
found in the scan list and its connection is intiated.
---
src/service.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/src/service.c b/src/service.c
index f6a76f6..7d3847e 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4015,33 +4015,13 @@ static DBusMessage *connect_service(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
struct connman_service *service = user_data;
- int index, err = 0;
- GList *list;
+ int err = 0;
DBG("service %p", service);
if (service->pending)
return __connman_error_in_progress(msg);
- index = __connman_service_get_index(service);
-
- for (list = service_list; list; list = list->next) {
- struct connman_service *temp = list->data;
-
- if (!is_connecting(temp) && !is_connected(temp))
- break;
-
- if (service == temp)
- continue;
-
- if (service->type != temp->type)
- continue;
-
- if (__connman_service_get_index(temp) == index &&
- __connman_service_disconnect(temp) == -EINPROGRESS)
- err = -EINPROGRESS;
-
- }
if (err == -EINPROGRESS)
return __connman_error_operation_timeout(msg);
@@ -5923,11 +5903,31 @@ static void prepare_8021x(struct connman_service *service)
static int service_connect(struct connman_service *service)
{
- int err;
+ int err, index;
+ GList *list;
if (service->hidden)
return -EPERM;
+ index = __connman_service_get_index(service);
+
+ for (list = service_list; list; list = list->next) {
+ struct connman_service *temp = list->data;
+
+ if (!is_connecting(temp) && !is_connected(temp))
+ break;
+
+ if (service == temp)
+ continue;
+
+ if (service->type != temp->type)
+ continue;
+
+ if (__connman_service_get_index(temp) == index &&
+ __connman_service_disconnect(temp) == -EINPROGRESS)
+ return -ETIMEDOUT;
+ }
+
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM:
--
1.9.1
4 years, 2 months