[PATCH 0/2] DHCPv6 infinite expiry times
by Patrik Flykt
Hi,
This patch set is heavily influenced by the patch set from
wangfe(a)nestlabs.com. The difference is that T1, T2 and expiry
timeouts are all set to 0xffffffff (infinite) when the expiry
time is infinite. With this it is believed any further changes
will be much smaller, as the code already checks for T1 and
T2 being unequal to 0xffffffff.
Wang Feng, does this work with your setup?
Cheers,
Patrik
Patrik Flykt (2):
dhcpv6: Return -EISCONN when the expiry time is inifinite
gdhcp: Set T1 and T2 to infinite if expiry time is infinite
gdhcp/client.c | 9 ++++++---
src/dhcpv6.c | 5 +++++
2 files changed, 11 insertions(+), 3 deletions(-)
--
2.8.1
4 years, 4 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, 5 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, 5 months
[PATCH] service: Update nameservers automatically
by Patrik Flykt
Automatically update nameserver information when they are appended
or removed. 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.
---
Hi,
Here is a patch that updates nameserver info also if it changes while a
service is connected. The issue was reported by Thomas Green a long time
ago end of August, but at that point I had a bit wrong idea on how to fix
the issue. So here is hopefully a solution that works in all cases.
Please test,
Patrik
src/service.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 2 deletions(-)
diff --git a/src/service.c b/src/service.c
index ee10e6c..6877b9a 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)
@@ -1139,6 +1182,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;
@@ -1207,6 +1252,8 @@ set_servers:
nameserver);
}
+ nameservers_changed(service);
+
return 0;
}
@@ -4500,6 +4547,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 +5492,7 @@ static int service_indicate_state(struct connman_service *service)
g_get_current_time(&service->modified);
service_save(service);
- dns_changed(service);
+ nameservers_changed(service);
domain_changed(service);
proxy_changed(service);
@@ -5481,7 +5533,7 @@ static int service_indicate_state(struct connman_service *service)
__connman_wpad_stop(service);
- dns_changed(service);
+ nameservers_changed(service);
domain_changed(service);
proxy_changed(service);
--
2.9.3
4 years, 5 months
[PATCH] Remove unnecessary continue in set_tethering API
by Milind Murhekar
---
src/technology.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/technology.c b/src/technology.c
index 17ed456..4574f1e 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -270,10 +270,8 @@ static int set_tethering(struct connman_technology *technology,
if (result == -EINPROGRESS)
continue;
- if (err == -EINPROGRESS || err == 0) {
+ if (err == -EINPROGRESS || err == 0)
result = err;
- continue;
- }
}
return result;
--
1.9.1
4 years, 5 months
[PATCH] stats: Remove comment on valid file descriptor
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
The comment doesn't provide any real additional information. It was
documented why fd = -1 in the original commit.
---
src/stats.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/stats.c b/src/stats.c
index 98ce6d9ef741..eed6e8a1c09b 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -647,10 +647,6 @@ static int stats_file_history_update(struct stats_file *data_file)
bzero(history_file, sizeof(struct stats_file));
bzero(temp_file, sizeof(struct stats_file));
- /*
- * 0 is a valid file descriptor - fd needs to be initialized
- * to -1 to handle errors correctly
- */
history_file->fd = -1;
temp_file->fd = -1;
@@ -703,10 +699,6 @@ int __connman_stats_service_register(struct connman_service *service)
if (!file)
return -ENOMEM;
- /*
- * 0 is a valid file descriptor - fd needs to be initialized
- * to -1 to handle errors correctly
- */
file->fd = -1;
g_hash_table_insert(stats_hash, service, file);
--
2.7.4
4 years, 5 months
[PATCH][v2] tethering: Add verification to bridge creation and configuration
by Jose Blanquicet
Version 2:
- Return 0 (No error) in case __sync_fetch_and_add(&tethering_enabled, 1) != 0.
- Split up PATCH v1 into multiple patches as requested.
As I told before, use this verification in others tethering technologies should
be evaluated and implemented in case it is advantageous. I will let this in the
hands of someone with more expertise/knowledge on those other technologies. I
only focused on WiFi. Should I add also the TODO comments into the other plugins
as I had done for v1?
Jose Blanquicet (3):
tethering: Propagate error value when enabling tethering
technology: Handle errors when enabling tethering
wifi: Abort tethering enabling if bridge creation/configuration fails
include/technology.h | 2 +-
plugins/wifi.c | 23 ++++++++++++++++++-----
src/connman.h | 2 +-
src/technology.c | 19 ++++++++++++-------
src/tethering.c | 16 +++++++++-------
5 files changed, 41 insertions(+), 21 deletions(-)
--
1.9.1
4 years, 5 months
[PATCH] Removed redundant NULL check for nameservers in __connman_service_nameserver_remove()
by Nishant Chaprana
Signed-off-by: Nishant Chaprana <n.chaprana(a)samsung.com>
---
src/service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/service.c b/src/service.c
index ee10e6c..f6a76f6 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1164,7 +1164,7 @@ int __connman_service_nameserver_remove(struct connman_service *service,
if (!nameservers)
return 0;
- for (i = 0; nameservers && nameservers[i]; i++)
+ for (i = 0; nameservers[i]; i++)
if (g_strcmp0(nameservers[i], nameserver) == 0) {
found = true;
break;
--
1.9.1
4 years, 5 months