[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
5 years, 7 months
[PATCH 0/1] Fix nameserver and search domain ordering when writing resolv.conf
by Sam Nazarko
Hi,
This patch fixes an issue where DNS servers and search domains are written to
resolv.conf in the reverse order. This has caused problems with some OSMC users that
have relied on the primary DNS server to be listed first and have a faulty or intermittent
secondary DNS server. While I am in agreement that these users should fix their secondary
DNS server, we should still respect the ordering that they configure or get via DHCP.
I previously submitted a patch to this mailing list in hope of addressing an issue
however the ConnMan mailing list disappeared for a while and I lost my post. This
new patch resolves both search domains and DNS servers being out of order.
Sam Nazarko
5 years, 9 months
[PATCH v0 0/2] OpenVPN logging
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
Hi,
I am debugging some network setups here and found out that we don't
log anything from OpenVPN which is pretty sad. Let's fix this.
cheers,
daniel
Daniel Wagner (2):
openvpn: Fix stdout/stderr forwarding from deamon
openvpn: Add verbose flag
vpn/plugins/openvpn.c | 49 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 5 deletions(-)
--
2.5.5
5 years, 9 months
[PATCH 0/3] New WPS Implementation
by Jose Blanquicet
Hi,
this is the WPS implementation following our previous agreements.
Please, let us know what do you think.
Best Regards,
Jose Blanquicet
Jose Blanquicet (3):
technology: Add specific D-Bus methods for WPS connections
technology: Add WPS Cancel feature
client: Add commands for new specific WPS D-Bus methods
client/commands.c | 125 ++++++++++++++++
client/dbus_helpers.c | 2 +-
doc/agent-api.txt | 6 +
doc/connmanctl.1.in | 14 +-
doc/technology-api.txt | 43 ++++++
gsupplicant/gsupplicant.h | 18 +++
gsupplicant/supplicant.c | 321 ++++++++++++++++++++++++++++------------
include/technology.h | 11 ++
plugins/wifi.c | 364 +++++++++++++++++++++++++++++++++++++++++++---
src/connman.h | 1 +
src/peer.c | 5 +-
src/technology.c | 160 ++++++++++++++++++++
12 files changed, 949 insertions(+), 121 deletions(-)
--
1.9.1
5 years, 10 months
Connman on Android/Brillo
by Naveen Singh
Hi Patrick
I had this talk with Marcel few weeks back about compiling connman on
Android/Brillo. This would surely give connman the penetration into
Android world and future IoT devices which are based of Brillo.
I actually got it compiled and working. There are two challenges:
a) Some of the libraries that are required by connman are missing. For
my work I got those libraries compiled first.
b) Changes in connman itself: Open source connman does not compile as
such for Android/Brillo. There are some changes needed in connman to
get this going. I would like to see if we can upstream these changes.
The intent of this email is to discuss those changes. Following are
the changes needed:
1) Backtrace system call: In log.c from function print_backtrace we
call backtrace. It is a glibc API and is no present in bionic. There
is an equivalent function in bionic for doing this.
2) hard check for ns_initparse in libresolv.so: There is no
libresolv.so for android/Brillo. All these ns_* symbols are part of
libc.so. So hard check has to go. We may need to check in configure.ac
whether we are compiling against glibc or bionic early on and do stuff
differently.
3) NTP code calls adjtime to adjust clock. This function is missing in
bionic. We may need to find a similar function in bionic for doing
this.
4) struct in6_pktinfo is defined in connman code (file gdhcp/common.h)
under #ifndef __USE_GNU. Now this structure is defined in bionic
header file libc/kernel/uapi/ipv6.h. Not sure what is the intent of
#ifndef __USE_GNU? Should this go away? Similarly struct in6_ifreq is
defined in inet.c file and it is also defined in the same bionic
header file. I had to comment out this definition to compile connman.
5) Some of the structures which are needed for connman compilation are
defined under #ifdef __USE_BSD in bionic header file. For Bionic
__USE_BSD is defined only if _GNU_SOURCE is defined. So for those
files in connman we have to define _GNU_SOURCE as the first line in
that file. Example is ipv4ll.c. I hope this should be OK.
6) GResolv structure in gresolv.c: struct __res_state is a member for
GResolv structure. This structure is defined in resolv.h file in
glibc. struct __res_state in bionic requires inclusion of two other
header files resolv_private.h and res_private. Also this structure is
defined very differently between bionic and glibc. This caused changes
in gresolv.c, the way it accesses various members of this structure.
7) Struct sockaddr_in6 defined differently b/w bionic and glibc.
8) ETH_ALEN is not defined in bionic header file
9) Need to include resolv_params.h in resolver.c. This is because
"MAXDNSRCH" etc is defined in resolv_params.h in bionic.
10) Needed to remove "-lresolv -lrt" from Makefile.am.
Some of these changes are easily doable if we can have #ifdef ANDROID
in code. Through configure.ac we can detect if we are compiling
against bionic or glibc and appropriately turn on this flag. Not sure
what your thought are on this.
Regards
Naveen
5 years, 10 months
[PATCH] connman.service: Use ProtectSystem=true to allow writing /etc/localtime
by Philip Withnall
Setting the timezone requires unlinking and relinking /etc/localtime,
so
we need /etc to be mounted read–write. This means that commit dc8f151e
has to be softened to ProtectSystem=true rather than
ProtectSystem=full. This mounts most of the filesystem as read-only,
apart from /etc, which is read–write.
Signed-off-by: Philip Withnall <philip.withnall(a)collabora.co.uk>
---
src/connman.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/connman.service.in b/src/connman.service.in
index 57eaaf9..d5d6d44 100644
--- a/src/connman.service.in
+++ b/src/connman.service.in
@@ -15,7 +15,7 @@ ExecStart=@sbindir@/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
+ProtectSystem=true
[Install]
WantedBy=multi-user.target
--
2.5.5
5 years, 10 months
[PATCH] service: Enable ipconfig only for the changed IP type
by Saurav Babu
When IPv6.Configuration is changed to "off" then connman starts fresh
DHCP Requests for service after changing its state to Configuration.
In an ideal scenario IPv4 Configurations should not be affected on
changing IPv6.Configuration property.
This patch only enables ipconfig for the changed IP type and leaves
other IP type unchanged
---
src/service.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/service.c b/src/service.c
index 768426b..37af5fc 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3482,9 +3482,11 @@ static DBusMessage *set_property(DBusConnection *conn,
if (err < 0) {
if (is_connected_state(service, state) ||
is_connecting_state(service, state)) {
- __connman_network_enable_ipconfig(service->network,
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ __connman_network_enable_ipconfig(service->network,
service->ipconfig_ipv4);
- __connman_network_enable_ipconfig(service->network,
+ else
+ __connman_network_enable_ipconfig(service->network,
service->ipconfig_ipv6);
}
@@ -3497,10 +3499,12 @@ static DBusMessage *set_property(DBusConnection *conn,
ipv6_configuration_changed(service);
if (is_connecting(service) || is_connected(service)) {
- __connman_network_enable_ipconfig(service->network,
- service->ipconfig_ipv4);
- __connman_network_enable_ipconfig(service->network,
- service->ipconfig_ipv6);
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ __connman_network_enable_ipconfig(service->network,
+ service->ipconfig_ipv4);
+ else
+ __connman_network_enable_ipconfig(service->network,
+ service->ipconfig_ipv6);
}
service_save(service);
--
1.9.1
5 years, 10 months
[PATCH] rtnl: Treat bond interfaces as ethernet
by Justin Maggard
Since Linux 3.9, the kernel started setting the sysfs DEVTYPE for bond
interfaces to 'bond', which made connman start classifying the service
type and device type as UNKNOWN. So we need to handle DEVTYPE=bond so
we can configure bond inferfaces on modern kernels.
Signed-off-by: Justin Maggard <jmaggard(a)netgear.com>
---
src/rtnl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/rtnl.c b/src/rtnl.c
index d1b851f..0e58eef 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -173,7 +173,9 @@ static void read_uevent(struct interface_data *interface)
} else if (strcmp(line + 8, "vlan") == 0) {
interface->service_type = CONNMAN_SERVICE_TYPE_ETHERNET;
interface->device_type = CONNMAN_DEVICE_TYPE_ETHERNET;
-
+ } else if (strcmp(line + 8, "bond") == 0) {
+ interface->service_type = CONNMAN_SERVICE_TYPE_ETHERNET;
+ interface->device_type = CONNMAN_DEVICE_TYPE_ETHERNET;
} else {
interface->service_type = CONNMAN_SERVICE_TYPE_UNKNOWN;
interface->device_type = CONNMAN_DEVICE_TYPE_UNKNOWN;
--
2.9.1
5 years, 10 months
[PATCH] ntp: Use adjtimex to tune the kernel clock
by Justin Maggard
Replace adjtime()/gettimeofday() calls with the RFC 5905 clock
adjustment algorithm implemented by adjtimex(). This also allows us to
support leap seconds sent from an NTP server.
This code is more-or-less ripped straight from systemd timesyncd.
Signed-off-by: Justin Maggard <jmaggard(a)netgear.com>
---
src/ntp.c | 62 ++++++++++++++++++++++++++++++++++++--------------------------
1 file changed, 36 insertions(+), 26 deletions(-)
diff --git a/src/ntp.c b/src/ntp.c
index dd246eb..9b1bb4f 100644
--- a/src/ntp.c
+++ b/src/ntp.c
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
+#include <sys/timex.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
@@ -66,9 +67,13 @@ struct ntp_msg {
#define OFFSET_1900_1970 2208988800UL /* 1970 - 1900 in seconds */
-#define STEPTIME_MIN_OFFSET 0.128
+#define STEPTIME_MIN_OFFSET 0.4
#define LOGTOD(a) ((a) < 0 ? 1. / (1L << -(a)) : 1L << (int)(a))
+#define NSEC_PER_SEC ((uint64_t)1000000000ULL)
+#ifndef ADJ_SETOFFSET
+#define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */
+#endif
#define NTP_SEND_TIMEOUT 2
#define NTP_SEND_RETRIES 3
@@ -247,6 +252,7 @@ static void decode_msg(void *base, size_t len, struct timeval *tv,
double m_delta, org, rec, xmt, dst;
double delay, offset;
static guint transmit_delay;
+ struct timex tmx = {};
if (len < sizeof(*msg)) {
connman_error("Invalid response from time server");
@@ -336,39 +342,43 @@ static void decode_msg(void *base, size_t len, struct timeval *tv,
poll_id = g_timeout_add_seconds(transmit_delay, next_poll, NULL);
- connman_info("ntp: time slew %+.6f s", offset);
-
if (offset < STEPTIME_MIN_OFFSET && offset > -STEPTIME_MIN_OFFSET) {
- struct timeval adj;
-
- adj.tv_sec = (long) offset;
- adj.tv_usec = (offset - adj.tv_sec) * 1000000;
+ tmx.modes = ADJ_STATUS | ADJ_NANO | ADJ_OFFSET | ADJ_TIMECONST | ADJ_MAXERROR | ADJ_ESTERROR;
+ tmx.status = STA_PLL;
+ tmx.offset = offset * NSEC_PER_SEC;
+ tmx.constant = msg->poll - 4;
+ tmx.maxerror = 0;
+ tmx.esterror = 0;
+
+ connman_info("ntp: adjust (slew): %+.6f sec", offset);
+ } else {
+ tmx.modes = ADJ_STATUS | ADJ_NANO | ADJ_SETOFFSET;
- DBG("adjusting time %ld seconds, %ld msecs", adj.tv_sec, adj.tv_usec);
+ /* 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;
- if (adjtime(&adj, &adj) < 0) {
- connman_error("Failed to adjust time");
- return;
+ /* the kernel expects -0.3s as {-1, 7000.000.000} */
+ if (tmx.time.tv_usec < 0) {
+ tmx.time.tv_sec -= 1;
+ tmx.time.tv_usec += NSEC_PER_SEC;
}
- DBG("remaining adjustment %ld seconds, %ld msecs", adj.tv_sec, adj.tv_usec);
- } else {
- struct timeval cur;
- double dtime;
-
- gettimeofday(&cur, NULL);
- dtime = offset + cur.tv_sec + 1.0e-6 * cur.tv_usec;
- cur.tv_sec = (long) dtime;
- cur.tv_usec = (dtime - cur.tv_sec) * 1000000;
-
- DBG("setting time: %ld seconds, %ld msecs", cur.tv_sec, cur.tv_usec);
+ connman_info("ntp: adjust (jump): %+.6f sec", offset);
+ }
- if (settimeofday(&cur, NULL) < 0) {
- connman_error("Failed to set time");
- return;
- }
+ if (NTP_FLAGS_LI_DECODE(msg->flags) & NTP_FLAG_LI_ADDSECOND)
+ tmx.status |= STA_INS;
+ else if (NTP_FLAGS_LI_DECODE(msg->flags) & NTP_FLAG_LI_DELSECOND)
+ tmx.status |= STA_DEL;
+ if (adjtimex(&tmx) < 0) {
+ connman_error("Failed to adjust time");
+ return;
}
+
+ DBG("interval/delta/delay/drift %fs/%+.3fs/%.3fs/%+ldppm",
+ LOGTOD(msg->poll), offset, delay, tmx.freq / 65536);
}
static gboolean received_data(GIOChannel *channel, GIOCondition condition,
--
2.9.1
5 years, 10 months