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: Question about "MoveBefore" and notifications (Patrik Flykt)
   2. [PATCH 1/3] Use AC_USE_SYSTEM_EXTENSIONS (Ross Burton)
   3. [PATCH 2/3] Check for in6_pktinfo.ipi6_addr explicitly
      (Ross Burton)
   4. [PATCH 3/3] Rationalise includes (Ross Burton)
   5. RE: NTP service (Thomas Green)
   6. [PATCH] stats: add --enable-stats/--disable-stats compile
      flag. (Feng Wang)


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

Message: 1
Date: Tue, 09 Aug 2016 16:48:48 +0300
From: Patrik Flykt <[email protected]>
To: "l.genevet" <[email protected]>, [email protected]
Subject: Re: Question about "MoveBefore" and notifications
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Mon, 2016-08-01 at 14:50 +0200, l.genevet wrote:
> I am working on an connman integrated in an embedded system for home?
> automation. We are using Connman 1.23

Ouch. Please upgrade to latest, we have fixed a few metric tons of bugs
since then. ConnMan 1.33 is 100% API compatible with 1.23, and if you
discover that it isn't, it's our fault and we will fix it immediately.?

Latest oFono releases also contain bug fixes.

>  with an Ofono plugin to be able to switch to a ?GSM modem in case of
> an issue with the ethernet interface.
> 
> If we are not able to ping our server even if the ethernet service is
> ready, we would like to force the switch to the GSM. For that, we use
> the connman Service MoveBefore API.
> 
> After MoveBefore :
> - the GSM interface is used.
> - the default route is up to date.
> But
> - connman does not notify a change of State on the ethernet or the
> GSM?
> interface.
> - the services are not reordered after the switch.

The problem with MoveBefore and MoveAfter is that they don't
unfortunately keep services ordered forever. And the services are
ordered internally by ConnMan every time a state changes or a new
service is discovered, which can mean pretty much immediately.

The ServicesChanged signal contains the latest order, the topmost entry
is the one with the default route set if it is in states 'ready' or
'online'. But ServicesChanged are sent with a delay, meaning that
ConnMan has enough time to decide to re-sort the services list and end
up with the same order as before the switch before sending out the
signal... So currently MoveBefore/MoveAfter are not that useful and
require a bit more coding to get properly done.

> Is this seems??like a normal behaviour ?
>
> Are there any other way to be notified via connman that the default?
> route has changed?
> I saw that IPv4 "Gateway" field of the ethernet interface disappears?
> once MoveBefore GSM has changed -> can I use that information to be
> sure?
> ethernet does not have the default route anymore?

Individual services should send out information for any changed
property, please try with the latest version and see if your problem
persists.

Cheers,

        Patrik


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

Message: 2
Date: Tue,  9 Aug 2016 17:00:05 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 1/3] Use AC_USE_SYSTEM_EXTENSIONS
Message-ID: <[email protected]>

Instead of using #define _GNU_SOURCE in some source files which causes problems
when building with musl as more files need the define, simply use
AC_USE_SYSTEM_EXTENSIONS in configure.ac to get it defined globally.
---
 configure.ac       | 1 +
 gdhcp/client.c     | 1 -
 plugins/tist.c     | 1 -
 src/backtrace.c    | 1 -
 src/inet.c         | 1 -
 src/log.c          | 1 -
 src/ntp.c          | 1 -
 src/resolver.c     | 1 -
 src/rfkill.c       | 1 -
 src/stats.c        | 1 -
 src/timezone.c     | 1 -
 tools/stats-tool.c | 1 -
 tools/tap-test.c   | 1 -
 tools/wispr.c      | 1 -
 vpn/plugins/vpn.c  | 1 -
 15 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6e66ab3..bacf5ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ AC_SUBST(abs_top_srcdir)
 AC_SUBST(abs_top_builddir)
 
 AC_LANG_C
+AC_USE_SYSTEM_EXTENSIONS
 
 AC_PROG_CC
 AM_PROG_CC_C_O
diff --git a/gdhcp/client.c b/gdhcp/client.c
index fbb40ab..3aeb089 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
diff --git a/plugins/tist.c b/plugins/tist.c
index ad5ef79..cc2800a 100644
--- a/plugins/tist.c
+++ b/plugins/tist.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdbool.h>
 #include <stdlib.h>
diff --git a/src/backtrace.c b/src/backtrace.c
index 6a66c0a..4dbdda8 100644
--- a/src/backtrace.c
+++ b/src/backtrace.c
@@ -24,7 +24,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/src/inet.c b/src/inet.c
index 69ded19..81d92c2 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -25,7 +25,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
diff --git a/src/log.c b/src/log.c
index 9bae4a3..f7e82e5 100644
--- a/src/log.c
+++ b/src/log.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <unistd.h>
 #include <stdarg.h>
diff --git a/src/ntp.c b/src/ntp.c
index dd246eb..db8ae96 100644
--- a/src/ntp.c
+++ b/src/ntp.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <errno.h>
 #include <fcntl.h>
 #include <unistd.h>
diff --git a/src/resolver.c b/src/resolver.c
index fbe4be7..ef61f92 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
 #include <fcntl.h>
diff --git a/src/rfkill.c b/src/rfkill.c
index 2bfb092..af49d12 100644
--- a/src/rfkill.c
+++ b/src/rfkill.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
 #include <fcntl.h>
diff --git a/src/stats.c b/src/stats.c
index 26343b1..cfcdc94 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <errno.h>
 #include <sys/mman.h>
 #include <sys/types.h>
diff --git a/src/timezone.c b/src/timezone.c
index e346b11..8e91267 100644
--- a/src/timezone.c
+++ b/src/timezone.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>
diff --git a/tools/stats-tool.c b/tools/stats-tool.c
index b076478..428d94b 100644
--- a/tools/stats-tool.c
+++ b/tools/stats-tool.c
@@ -22,7 +22,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/tools/tap-test.c b/tools/tap-test.c
index fdc098a..57917f5 100644
--- a/tools/tap-test.c
+++ b/tools/tap-test.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
 #include <fcntl.h>
diff --git a/tools/wispr.c b/tools/wispr.c
index d5f9341..e56dfc1 100644
--- a/tools/wispr.c
+++ b/tools/wispr.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <fcntl.h>
 #include <unistd.h>
diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index 9a42385..479c3a7 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #endif
 
-#define _GNU_SOURCE
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
-- 
2.8.1



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

Message: 3
Date: Tue,  9 Aug 2016 17:00:06 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 2/3] Check for in6_pktinfo.ipi6_addr explicitly
Message-ID: <[email protected]>

Instead of assuming that just glibc has this structure, check for it at
configure as musl also has it.

Based on work by Khem Raj <[email protected]>.
---
 configure.ac   | 2 ++
 gdhcp/common.h | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index bacf5ec..ad00456 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,6 +186,8 @@ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
 AC_CHECK_HEADERS([execinfo.h])
 AM_CONDITIONAL([BACKTRACE], [test "${ac_cv_header_execinfo_h}" = "yes"])
 
+AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include 
<netinet/in.h>]])
+
 AC_CHECK_FUNC(signalfd, dummy=yes,
                        AC_MSG_ERROR(signalfd support is required))
 
diff --git a/gdhcp/common.h b/gdhcp/common.h
index 75abc18..6899499 100644
--- a/gdhcp/common.h
+++ b/gdhcp/common.h
@@ -19,6 +19,7 @@
  *
  */
 
+#include <config.h>
 #include <netinet/udp.h>
 #include <netinet/ip.h>
 
@@ -170,8 +171,8 @@ static const uint8_t dhcp_option_lengths[] = {
        [OPTION_U32]    = 4,
 };
 
-/* already defined within netinet/in.h if using GNU compiler */
-#ifndef __USE_GNU
+/* already defined within netinet/in.h if using glibc or musl */
+#ifndef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
 struct in6_pktinfo {
        struct in6_addr ipi6_addr;  /* src/dst IPv6 address */
        unsigned int ipi6_ifindex;  /* send/recv interface index */
-- 
2.8.1



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

Message: 4
Date: Tue,  9 Aug 2016 17:00:07 +0100
From: Ross Burton <[email protected]>
To: [email protected]
Subject: [PATCH 3/3] Rationalise includes
Message-ID: <[email protected]>

gweb/gresolv.c uses snprintf() and isspace() so it should include stdio.h and
ctype.h.

tools/dnsproxy-test uses functions from stdio.h.

musl warns when sys/ headers are included when the non-sys form should be used,
so switch sys/errno.h and so on to errno.h.

musl also causes redefinition errors when pieces of the networking headers are
included, so remove the redundant includes.

Based on work by Khem Raj <[email protected]>.
---
 gweb/gresolv.c               | 2 ++
 plugins/wifi.c               | 3 +--
 src/ippool.c                 | 1 -
 src/iptables.c               | 2 +-
 src/tethering.c              | 2 --
 tools/dhcp-test.c            | 1 -
 tools/dnsproxy-test.c        | 1 +
 tools/private-network-test.c | 2 +-
 tools/tap-test.c             | 2 +-
 9 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 8a51a9f..d55027c 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -23,11 +23,13 @@
 #include <config.h>
 #endif
 
+#include <ctype.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stdarg.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <resolv.h>
 #include <sys/types.h>
 #include <sys/socket.h>
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 9d56671..148131d 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -30,9 +30,8 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-#include <linux/if_arp.h>
-#include <linux/wireless.h>
 #include <net/ethernet.h>
+#include <linux/wireless.h>
 
 #ifndef IFF_LOWER_UP
 #define IFF_LOWER_UP   0x10000
diff --git a/src/ippool.c b/src/ippool.c
index cea1dcc..8a645da 100644
--- a/src/ippool.c
+++ b/src/ippool.c
@@ -28,7 +28,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/errno.h>
 #include <sys/socket.h>
 
 #include "connman.h"
diff --git a/src/iptables.c b/src/iptables.c
index 5ef757a..82e3ac4 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <sys/socket.h>
 #include <xtables.h>
 #include <inttypes.h>
diff --git a/src/tethering.c b/src/tethering.c
index 3153349..ad062d5 100644
--- a/src/tethering.c
+++ b/src/tethering.c
@@ -31,10 +31,8 @@
 #include <stdio.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
-#include <linux/sockios.h>
 #include <string.h>
 #include <fcntl.h>
-#include <linux/if_tun.h>
 #include <netinet/in.h>
 #include <linux/if_bridge.h>
 
diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
index c34e10a..eae66fc 100644
--- a/tools/dhcp-test.c
+++ b/tools/dhcp-test.c
@@ -33,7 +33,6 @@
 #include <arpa/inet.h>
 #include <net/route.h>
 #include <net/ethernet.h>
-#include <linux/if_arp.h>
 
 #include <gdhcp/gdhcp.h>
 
diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
index 551cae9..371e2e2 100644
--- a/tools/dnsproxy-test.c
+++ b/tools/dnsproxy-test.c
@@ -24,6 +24,7 @@
 #endif
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/tools/private-network-test.c b/tools/private-network-test.c
index 3dd115b..2828bb3 100644
--- a/tools/private-network-test.c
+++ b/tools/private-network-test.c
@@ -32,7 +32,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/signalfd.h>
 #include <unistd.h>
 
diff --git a/tools/tap-test.c b/tools/tap-test.c
index 57917f5..cb3ee62 100644
--- a/tools/tap-test.c
+++ b/tools/tap-test.c
@@ -28,7 +28,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 
 #include <netinet/in.h>
-- 
2.8.1



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

Message: 5
Date: Tue, 9 Aug 2016 16:25:39 +0000
From: Thomas Green <[email protected]>
To: "[email protected]" <[email protected]>
Subject: RE: NTP service
Message-ID:
        <c2bc44d770753c45aaac42695fb5be02012557a...@slc-exmb01.corp.srelay.com>
        
Content-Type: text/plain; charset="utf-8"

This is good for disabling it while running, but when starting connmand NTP 
time updates occur.  It would be good to have a way to disable it during build 
time, or a command line switch to disable any NTP time updates from occurring.

Tom

-----Original Message-----
From: Patrik Flykt [mailto:[email protected]] 
Sent: Tuesday, August 09, 2016 3:59 AM
To: Thomas Green <[email protected]>; [email protected]
Subject: Re: NTP service

On Mon, 2016-08-08 at 17:10 +0000, Thomas Green wrote:
> All,
> ?
> Is there a way to easily disable the NTP service?? Our application 
> does our own time services, and when connman conflicts with it, it 
> breaks our application.

NTP can be disabled by setting Clock API?TimeUpdates to 'manual', see 
doc/clock-api.txt. You can check its value with 'connmanctl clock'; patches for 
setting Clock API properties with connmanctl would be nice...


Cheers,

        Patrik

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

Message: 6
Date: Tue,  9 Aug 2016 10:43:12 -0700
From: Feng Wang <[email protected]>
To: [email protected]
Subject: [PATCH] stats: add --enable-stats/--disable-stats compile
        flag.
Message-ID: <[email protected]>

This flag turns on/off the persistent statistic numbers support.
---
 Makefile.am  |  4 ++++
 configure.ac |  5 +++++
 src/stats.c  | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index d70725c..fd38bb9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -223,6 +223,10 @@ else
 AM_CPPFLAGS = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
 endif
 
+if STATS
+AM_CPPFLAGS += -DCONNMAN_WITH_STATS
+endif
+
 src_connmand_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
                                @GNUTLS_CFLAGS@ $(builtin_cflags) \
                                -DCONNMAN_PLUGIN_BUILTIN \
diff --git a/configure.ac b/configure.ac
index c330314..a8a03a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -352,6 +352,11 @@ AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
                                        [enable_tools=${enableval}])
 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
 
+AC_ARG_ENABLE(stats, AC_HELP_STRING([--disable-stats],
+              [disable stats file support]),
+                                       [enable_stats=${enableval}])
+AM_CONDITIONAL(STATS, test "${enable_stats}" != "no")
+
 if (test "${enable_tools}" != "no"); then
        AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
                                                $PATH:/sbin:/usr/sbin)
diff --git a/src/stats.c b/src/stats.c
index 26343b1..8fb2139 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -37,6 +37,7 @@
 
 #include "connman.h"
 
+#ifdef CONNMAN_WITH_STATS
 #define MODE           (S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | \
                        S_IXGRP | S_IROTH | S_IXOTH)
 
@@ -823,3 +824,38 @@ void __connman_stats_cleanup(void)
        g_hash_table_destroy(stats_hash);
        stats_hash = NULL;
 }
+
+#else
+
+int __connman_stats_service_register(struct connman_service *service)
+{
+       return -ENOTSUP;
+}
+
+void __connman_stats_service_unregister(struct connman_service *service)
+{
+}
+
+int  __connman_stats_update(struct connman_service *service,
+                               bool roaming,
+                               struct connman_stats_data *data)
+{
+       return 0;
+}
+
+int __connman_stats_get(struct connman_service *service,
+                               bool roaming,
+                               struct connman_stats_data *data)
+{
+       return 0;
+}
+
+int __connman_stats_init(void)
+{
+       return 0;
+}
+
+void __connman_stats_cleanup(void)
+{
+}
+#endif /* CONNMAN_WITH_STATS */
-- 
2.8.0.rc3.226.g39d4020



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

Subject: Digest Footer

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


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

End of connman Digest, Vol 10, Issue 5
**************************************

Reply via email to