connman: update to connman-1.36

This commit is contained in:
MilhouseVH 2018-05-12 19:03:39 +01:00
parent 854e10f551
commit 01832667fe
3 changed files with 2 additions and 292 deletions

View File

@ -17,8 +17,8 @@
################################################################################
PKG_NAME="connman"
PKG_VERSION="1.35"
PKG_SHA256="66d7deb98371545c6e417239a9b3b3e3201c1529d08eedf40afbc859842cf2aa"
PKG_VERSION="1.36"
PKG_SHA256="c789db41cc443fa41e661217ea321492ad59a004bebcd1aa013f3bc10a6e0074"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.connman.net"

View File

@ -1,141 +0,0 @@
From 5ca75ed2cfcc93fb63651965ec146dca3a394a9d Mon Sep 17 00:00:00 2001
From: Chris Novakovic <chris@chrisn.me.uk>
Date: Thu, 19 Apr 2018 01:29:43 +0100
Subject: [PATCH] build: Add --disable-stats option
Generation of interface statistics files can now be controlled at
compile-time using the --{enable,disable}-stats configure options.
Statistics files remain enabled by default.
Based on an idea by Feng Wang <wangfe@nestlabs.com>.
This is based on upstream commit 1946bbe0, which doesn't apply cleanly
against the latest stable release of ConnMan (1.35).
---
Makefile.am | 14 ++++++++++----
configure.ac | 5 +++++
src/nostats.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+), 4 deletions(-)
create mode 100644 src/nostats.c
diff --git a/Makefile.am b/Makefile.am
index e67a7a5..9c3b871 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,6 +43,12 @@ else
gweb_sources += gweb/giognutls.h gweb/gionotls.c
endif
+if STATS
+stats_sources = src/stats.c
+else
+stats_sources = src/nostats.c
+endif
+
if BACKTRACE
backtrace_sources = src/backtrace.c
endif
@@ -106,9 +112,9 @@ MANUAL_PAGES =
sbin_PROGRAMS = src/connmand src/connmand-wait-online
-src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) $(backtrace_sources) \
- $(builtin_sources) $(shared_sources) src/connman.ver \
- src/main.c src/connman.h src/log.c \
+src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) $(stats_sources) \
+ $(backtrace_sources) $(builtin_sources) $(shared_sources) \
+ src/connman.ver src/main.c src/connman.h src/log.c \
src/error.c src/plugin.c src/task.c \
src/device.c src/network.c src/connection.c \
src/manager.c src/service.c \
@@ -120,7 +126,7 @@ src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) $(backtrace_sources) \
src/storage.c src/dbus.c src/config.c \
src/technology.c src/counter.c src/ntp.c \
src/session.c src/tethering.c src/wpad.c src/wispr.c \
- src/stats.c src/dnsproxy.c src/6to4.c \
+ src/dnsproxy.c src/6to4.c \
src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
src/inotify.c src/ipv6pd.c src/peer.c \
src/peer_service.c src/machine.c src/util.c
diff --git a/configure.ac b/configure.ac
index 4baa685..56d4b50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -380,6 +380,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 statistics round robin file generation]),
+ [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/nostats.c b/src/nostats.c
new file mode 100644
index 0000000..3d0dc79
--- /dev/null
+++ b/src/nostats.c
@@ -0,0 +1,57 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2018 Chris Novakovic
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+
+#include "connman.h"
+
+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)
+{
+}
--
2.7.4

View File

@ -1,149 +0,0 @@
diff --git a/src/timeserver.c b/src/timeserver.c
index 0e555a73c3bf..fa878949dfba 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -34,9 +34,11 @@
#define TS_RECHECK_INTERVAL 7200
+static GSList *timeservers_list = NULL;
static GSList *ts_list = NULL;
static char *ts_current = NULL;
static int ts_recheck_id = 0;
+static int ts_backoff_id = 0;
static GResolv *resolv = NULL;
static int resolv_id = 0;
@@ -114,13 +116,59 @@ static void resolv_result(GResolvResultStatus status, char **results,
}
/*
- * Once the timeserver list (ts_list) is created, we start querying the
- * servers one by one. If resolving fails on one of them, we move to the
- * next one. The user can enter either an IP address or a URL for the
- * timeserver. We only resolve the URLs. Once we have an IP for the NTP
- * server, we start querying it for time corrections.
+ * Once the timeserver list (timeserver_list) is created, we start
+ * querying the servers one by one. If resolving fails on one of them,
+ * we move to the next one. The user can enter either an IP address or
+ * a URL for the timeserver. We only resolve the URLs. Once we have an
+ * IP for the NTP server, we start querying it for time corrections.
*/
-void __connman_timeserver_sync_next()
+static void timeserver_sync_start(void)
+{
+ GSList *list;
+
+ for (list = timeservers_list; list; list = list->next) {
+ char *timeserver = list->data;
+
+ ts_list = g_slist_prepend(ts_list, g_strdup(timeserver));
+ }
+ ts_list = g_slist_reverse(ts_list);
+
+ ts_current = ts_list->data;
+
+ ts_list = g_slist_delete_link(ts_list, ts_list);
+
+ /* if it's an IP, directly query it. */
+ if (connman_inet_check_ipaddress(ts_current) > 0) {
+ DBG("Using timeserver %s", ts_current);
+
+ __connman_ntp_start(ts_current);
+
+ return;
+ }
+
+ DBG("Resolving timeserver %s", ts_current);
+
+ resolv_id = g_resolv_lookup_hostname(resolv, ts_current,
+ resolv_result, NULL);
+
+ return;
+}
+
+static gboolean timeserver_sync_restart(gpointer user_data)
+{
+ timeserver_sync_start();
+ ts_backoff_id = 0;
+
+ return FALSE;
+}
+
+/*
+ * Select the next time server from the working list (ts_list) because
+ * for some reason the first time server in the list didn't work. If
+ * none of the server did work we start over with the first server
+ * with a backoff.
+ */
+void __connman_timeserver_sync_next(void)
{
if (ts_current) {
g_free(ts_current);
@@ -130,8 +178,13 @@ void __connman_timeserver_sync_next()
__connman_ntp_stop();
/* Get the 1st server in the list */
- if (!ts_list)
+ if (!ts_list) {
+ DBG("No timeserver could be used, restart probing in 5 seconds");
+
+ ts_backoff_id = g_timeout_add_seconds(5,
+ timeserver_sync_restart, NULL);
return;
+ }
ts_current = ts_list->data;
@@ -269,6 +322,11 @@ static void ts_recheck_disable(void)
g_source_remove(ts_recheck_id);
ts_recheck_id = 0;
+ if (ts_backoff_id) {
+ g_source_remove(ts_backoff_id);
+ ts_backoff_id = 0;
+ }
+
if (ts_current) {
g_free(ts_current);
ts_current = NULL;
@@ -327,20 +385,20 @@ int __connman_timeserver_sync(struct connman_service *default_service)
g_strfreev(nameservers);
- g_slist_free_full(ts_list, g_free);
+ g_slist_free_full(timeservers_list, g_free);
- ts_list = __connman_timeserver_get_all(service);
+ timeservers_list = __connman_timeserver_get_all(service);
- __connman_service_timeserver_changed(service, ts_list);
+ __connman_service_timeserver_changed(service, timeservers_list);
- if (!ts_list) {
+ if (!timeservers_list) {
DBG("No timeservers set.");
return 0;
}
ts_recheck_enable();
- __connman_timeserver_sync_next();
+ timeserver_sync_start();
return 0;
}
@@ -396,8 +454,10 @@ static void timeserver_stop(void)
resolv = NULL;
}
- g_slist_free_full(ts_list, g_free);
+ g_slist_free_full(timeservers_list, g_free);
+ timeservers_list = NULL;
+ g_slist_free_full(ts_list, g_free);
ts_list = NULL;
__connman_ntp_stop();
--
2.9.5