aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/connman/files')
-rw-r--r--net-misc/connman/files/connman-1.29-musl-sockaddr.patch12
-rw-r--r--net-misc/connman/files/connman-1.31-xtables.patch54
-rw-r--r--net-misc/connman/files/connman-1.32-execinfo.patch27
-rw-r--r--net-misc/connman/files/connman-1.33-polkit-configure-check-fix.patch15
-rw-r--r--net-misc/connman/files/connman-1.33-resolv-conf-overwrite.patch6
-rw-r--r--net-misc/connman/files/connman-musl-libresolv.patch61
-rw-r--r--net-misc/connman/files/connman-musl-log.patch29
-rw-r--r--net-misc/connman/files/connman-musl.patch125
-rw-r--r--net-misc/connman/files/connman.confd15
-rw-r--r--net-misc/connman/files/connman.initd223
-rw-r--r--net-misc/connman/files/connman.service11
11 files changed, 378 insertions, 0 deletions
diff --git a/net-misc/connman/files/connman-1.29-musl-sockaddr.patch b/net-misc/connman/files/connman-1.29-musl-sockaddr.patch
new file mode 100644
index 0000000..a5eb690
--- /dev/null
+++ b/net-misc/connman/files/connman-1.29-musl-sockaddr.patch
@@ -0,0 +1,12 @@
+diff -Naurw connman-1.29.orig/src/ntp.c connman-1.29/src/ntp.c
+--- connman-1.29.orig/src/ntp.c 2014-12-13 01:23:18.000000000 +0000
++++ connman-1.29/src/ntp.c 2015-08-12 16:17:19.636686053 +0000
+@@ -180,7 +180,7 @@
+ msg.xmttime.fraction = htonl(transmit_timeval.tv_usec * 1000);
+
+ len = sendto(fd, &msg, sizeof(msg), MSG_DONTWAIT,
+- &addr, sizeof(addr));
++ (struct sockaddr *) &addr, sizeof(addr));
+ if (len < 0) {
+ connman_error("Time request for server %s failed (%d/%s)",
+ server, errno, strerror(errno));
diff --git a/net-misc/connman/files/connman-1.31-xtables.patch b/net-misc/connman/files/connman-1.31-xtables.patch
new file mode 100644
index 0000000..84f4445
--- /dev/null
+++ b/net-misc/connman/files/connman-1.31-xtables.patch
@@ -0,0 +1,54 @@
+--- connman-1.31/src/iptables.c.old 2016-03-22 20:12:47.829460752 -0700
++++ connman-1.31/src/iptables.c 2016-03-22 21:33:36.835384724 -0700
+@@ -28,11 +28,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/errno.h>
+ #include <sys/socket.h>
+-#include <xtables.h>
++#include "connman_xtables.h"
+ #include <inttypes.h>
+
+ #include <linux/netfilter_ipv4/ip_tables.h>
+
+ #include "connman.h"
+--- connman-1.31/src/firewall.c.old 2016-03-22 21:29:01.959472262 -0700
++++ connman-1.31/src/firewall.c 2016-03-22 21:33:53.048144181 -0700
+@@ -23,11 +23,11 @@
+ #include <config.h>
+ #endif
+
+ #include <errno.h>
+
+-#include <xtables.h>
++#include "connman_xtables.h"
+ #include <linux/netfilter_ipv4/ip_tables.h>
+
+ #include "connman.h"
+
+ #define CHAIN_PREFIX "connman-"
+--- /dev/null 2016-03-18 06:21:16.372989086 -0700
++++ connman-1.31/include/connman_xtables.h 2016-03-22 21:32:21.349504786 -0700
+@@ -0,0 +1,21 @@
++#ifndef CONNMAN_XTABLES_H
++#define CONNMAN_XTABLES_H
++
++#include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) || \
++ LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
++#include <xtables.h>
++#else
++#ifdef __USE_MISC
++#define GENTOO_USE_MISC __USE_MISC
++#undef __USE_MISC
++#endif
++
++#include <xtables.h>
++
++#ifdef GENTOO_USE_MISC
++#define __USE_MISC GENTOO_USE_MISC
++#undef GENTOO_USE_MISC
++#endif
++#endif
++#endif
diff --git a/net-misc/connman/files/connman-1.32-execinfo.patch b/net-misc/connman/files/connman-1.32-execinfo.patch
new file mode 100644
index 0000000..66f9160
--- /dev/null
+++ b/net-misc/connman/files/connman-1.32-execinfo.patch
@@ -0,0 +1,27 @@
+diff -Naur connman-1.32/src/backtrace.c connman-1.32.new/src/backtrace.c
+--- connman-1.32/src/backtrace.c 2016-04-18 00:04:30.000000000 -0700
++++ connman-1.32.new/src/backtrace.c 2016-06-17 13:55:08.257320750 -0700
+@@ -29,7 +29,9 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef HAVE_EXECINFO_H
+ #include <execinfo.h>
++#endif
+ #include <dlfcn.h>
+
+ #include "connman.h"
+@@ -37,6 +39,7 @@
+ void print_backtrace(const char* program_path, const char* program_exec,
+ unsigned int offset)
+ {
++#ifdef HAVE_EXECINFO_H
+ void *frames[99];
+ size_t n_ptrs;
+ unsigned int i;
+@@ -135,4 +138,5 @@
+
+ close(outfd[1]);
+ close(infd[0]);
++#endif /* HAVE_EXECINFO_H */
+ }
diff --git a/net-misc/connman/files/connman-1.33-polkit-configure-check-fix.patch b/net-misc/connman/files/connman-1.33-polkit-configure-check-fix.patch
new file mode 100644
index 0000000..57ef5e8
--- /dev/null
+++ b/net-misc/connman/files/connman-1.33-polkit-configure-check-fix.patch
@@ -0,0 +1,15 @@
+--- connman-1.33/configure.ac.old 2016-10-09 11:26:43.137856416 -0700
++++ connman-1.33/configure.ac 2016-10-09 11:26:52.819722799 -0700
+@@ -281,11 +281,11 @@ AM_CONDITIONAL(NMCOMPAT, test "${enable_
+
+ AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
+ [enable PolicyKit support]),
+ [enable_polkit=${enableval}], [enable_polkit="no"])
+ if (test "${enable_polkit}" != "no"); then
+- POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
++ POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit-gobject-1`"
+ POLKIT_DATADIR=""
+ if (test -z "${POLKIT_DATADIR}"); then
+ POLKIT_DATADIR="${datadir}/polkit-1/actions"
+ fi
+ AC_SUBST(POLKIT_DATADIR)
diff --git a/net-misc/connman/files/connman-1.33-resolv-conf-overwrite.patch b/net-misc/connman/files/connman-1.33-resolv-conf-overwrite.patch
new file mode 100644
index 0000000..49bb8ba
--- /dev/null
+++ b/net-misc/connman/files/connman-1.33-resolv-conf-overwrite.patch
@@ -0,0 +1,6 @@
+--- connman-1.33/scripts/connman_resolvconf.conf.in.old 2016-10-09 11:27:20.425341843 -0700
++++ connman-1.33/scripts/connman_resolvconf.conf.in 2016-10-09 11:27:10.662476565 -0700
+@@ -1,2 +1,2 @@
+ d @runstatedir@/connman - - - -
+-L+ /etc/resolv.conf - - - - @runstatedir@/connman/resolv.conf
++L /etc/resolv.conf - - - - @runstatedir@/connman/resolv.conf
diff --git a/net-misc/connman/files/connman-musl-libresolv.patch b/net-misc/connman/files/connman-musl-libresolv.patch
new file mode 100644
index 0000000..c28a7c1
--- /dev/null
+++ b/net-misc/connman/files/connman-musl-libresolv.patch
@@ -0,0 +1,61 @@
+musl does not implement res_ninit
+
+diff --exclude '*.*o' -ru connman-1.24.orig/gweb/gresolv.c connman-1.24/gweb/gresolv.c
+--- connman-1.24.orig/gweb/gresolv.c 2014-07-18 20:17:25.000000000 -0300
++++ connman-1.24/gweb/gresolv.c 2014-07-18 20:24:01.874669130 -0300
+@@ -874,8 +874,6 @@
+ resolv->index = index;
+ resolv->nameserver_list = NULL;
+
+- res_ninit(&resolv->res);
+-
+ return resolv;
+ }
+
+@@ -915,8 +913,6 @@
+
+ flush_nameservers(resolv);
+
+- res_nclose(&resolv->res);
+-
+ g_free(resolv);
+ }
+
+@@ -1019,24 +1015,19 @@
+ debug(resolv, "hostname %s", hostname);
+
+ if (!resolv->nameserver_list) {
+- int i;
+-
+- for (i = 0; i < resolv->res.nscount; i++) {
+- char buf[100];
+- int family = resolv->res.nsaddr_list[i].sin_family;
+- void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
+-
+- if (family != AF_INET &&
+- resolv->res._u._ext.nsaddrs[i]) {
+- family = AF_INET6;
+- sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr;
++ FILE *f = fopen("/etc/resolv.conf", "r");
++ if (f) {
++ char line[256], *s;
++ int i;
++ while (fgets(line, sizeof(line), f)) {
++ if (strncmp(line, "nameserver", 10) || !isspace(line[10]))
++ continue;
++ for (s = &line[11]; isspace(s[0]); s++);
++ for (i = 0; s[i] && !isspace(s[i]); i++);
++ s[i] = 0;
++ g_resolv_add_nameserver(resolv, s, 53, 0);
+ }
+-
+- if (family != AF_INET && family != AF_INET6)
+- continue;
+-
+- if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
+- g_resolv_add_nameserver(resolv, buf, 53, 0);
++ fclose(f);
+ }
+
+ if (!resolv->nameserver_list)
+
diff --git a/net-misc/connman/files/connman-musl-log.patch b/net-misc/connman/files/connman-musl-log.patch
new file mode 100644
index 0000000..42516c9
--- /dev/null
+++ b/net-misc/connman/files/connman-musl-log.patch
@@ -0,0 +1,29 @@
+diff -Naurw connman-1.31.orig/src/log.c connman-1.31/src/log.c
+--- connman-1.31.orig/src/log.c 2014-04-04 05:12:07.000000000 -0700
++++ connman-1.31/src/log.c 2016-02-01 11:25:11.137973207 -0800
+@@ -30,7 +30,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#ifdef HAVE_EXECINFO_H
+ #include <execinfo.h>
++#endif
+ #include <dlfcn.h>
+
+ #include "connman.h"
+@@ -112,6 +114,7 @@
+
+ static void print_backtrace(unsigned int offset)
+ {
++#ifdef HAVE_EXECINFO_H
+ void *frames[99];
+ size_t n_ptrs;
+ unsigned int i;
+@@ -210,6 +213,7 @@
+
+ close(outfd[1]);
+ close(infd[0]);
++#endif /* HAVE_EXECINFO_H */
+ }
+
+ static void signal_handler(int signo)
diff --git a/net-misc/connman/files/connman-musl.patch b/net-misc/connman/files/connman-musl.patch
new file mode 100644
index 0000000..18f4087
--- /dev/null
+++ b/net-misc/connman/files/connman-musl.patch
@@ -0,0 +1,125 @@
+diff -Naurw connman-1.31.orig/configure.ac connman-1.31/configure.ac
+--- connman-1.31.orig/configure.ac 2015-12-27 19:05:49.000000000 -0800
++++ connman-1.31/configure.ac 2016-02-01 11:22:09.576978370 -0800
+@@ -175,6 +175,8 @@
+ AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
+ AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
+
++AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include <netinet/in.h>]])
++AC_CHECK_HEADERS(execinfo.h)
+ AC_CHECK_HEADERS(resolv.h, dummy=yes,
+ AC_MSG_ERROR(resolver header files are required))
+ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+diff -Naurw connman-1.31.orig/gdhcp/common.c connman-1.31/gdhcp/common.c
+--- connman-1.31.orig/gdhcp/common.c 2015-04-19 15:16:21.000000000 -0700
++++ connman-1.31/gdhcp/common.c 2016-02-01 11:22:46.169977330 -0800
+@@ -22,6 +22,7 @@
+ #include <config.h>
+ #endif
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+@@ -31,7 +32,6 @@
+ #include <string.h>
+ #include <endian.h>
+ #include <net/if_arp.h>
+-#include <linux/if.h>
+ #include <netpacket/packet.h>
+ #include <net/ethernet.h>
+ #include <arpa/inet.h>
+@@ -40,6 +40,8 @@
+ #include "gdhcp.h"
+ #include "common.h"
+
++#include <linux/if.h>
++
+ static const DHCPOption client_options[] = {
+ { OPTION_IP, 0x01 }, /* subnet-mask */
+ { OPTION_IP | OPTION_LIST, 0x03 }, /* routers */
+diff -Naurw connman-1.31.orig/gdhcp/common.h connman-1.31/gdhcp/common.h
+--- connman-1.31.orig/gdhcp/common.h 2015-04-19 15:16:21.000000000 -0700
++++ connman-1.31/gdhcp/common.h 2016-02-01 11:29:53.731965170 -0800
+@@ -18,6 +18,9 @@
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
+
+ #include <netinet/udp.h>
+ #include <netinet/ip.h>
+@@ -170,8 +173,8 @@
+ [OPTION_U32] = 4,
+ };
+
+-/* already defined within netinet/in.h if using GNU compiler */
+-#ifndef __USE_GNU
++/* already defined within netinet/in.h if using GNU compiler or musl libc */
++#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 */
+diff -Naurw connman-1.31.orig/gweb/gresolv.c connman-1.31/gweb/gresolv.c
+--- connman-1.31.orig/gweb/gresolv.c 2014-04-04 05:12:07.000000000 -0700
++++ connman-1.31/gweb/gresolv.c 2016-02-01 11:27:46.207968797 -0800
+@@ -24,6 +24,7 @@
+ #endif
+
+ #include <errno.h>
++#include <stdio.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <string.h>
+diff -Naurw connman-1.31.orig/plugins/wifi.c connman-1.31/plugins/wifi.c
+--- connman-1.31.orig/plugins/wifi.c 2015-12-27 19:05:49.000000000 -0800
++++ connman-1.31/plugins/wifi.c 2016-02-01 11:25:59.192971840 -0800
+@@ -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 -Naurw connman-1.31.orig/src/tethering.c connman-1.31/src/tethering.c
+--- connman-1.31.orig/src/tethering.c 2015-12-27 19:05:49.000000000 -0800
++++ connman-1.31/src/tethering.c 2016-02-01 11:26:50.049970394 -0800
+@@ -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 -Naurw connman-1.31.orig/tools/dhcp-test.c connman-1.31/tools/dhcp-test.c
+--- connman-1.31.orig/tools/dhcp-test.c 2013-08-19 09:57:25.000000000 -0700
++++ connman-1.31/tools/dhcp-test.c 2016-02-01 11:25:21.907972901 -0800
+@@ -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 -Naurw connman-1.31.orig/tools/dnsproxy-test.c connman-1.31/tools/dnsproxy-test.c
+--- connman-1.31.orig/tools/dnsproxy-test.c 2013-12-04 23:12:12.000000000 -0800
++++ connman-1.31/tools/dnsproxy-test.c 2016-02-01 11:27:04.525969982 -0800
+@@ -24,6 +24,7 @@
+ #endif
+
+ #include <errno.h>
++#include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
diff --git a/net-misc/connman/files/connman.confd b/net-misc/connman/files/connman.confd
new file mode 100644
index 0000000..6d0c399
--- /dev/null
+++ b/net-misc/connman/files/connman.confd
@@ -0,0 +1,15 @@
+# conf.d file for connman
+#
+# Please check connmand --help for more information.
+# Useful options are:
+# -c, --compat: enable NetworkManager compatibility mode.
+# -W, --wifi=NAME: select wpa_supplicant wifi driver to use.
+# This is useful if your wpa_supplicant is < 0.7
+# since connmand by default gives wpa_supplicant a
+# comma separated list of values and < 0.7 does not
+# understand or accept it.
+# -i, --device=DEV: force use of given interface name.
+# -I, --nodevice=DEV: force ignore of given interface name.
+# -p, --plugin=NAME: specify plugins to load.
+# -P, --noplugin=NAME: specify plugins not to load.
+CONNMAN_OPTS=""
diff --git a/net-misc/connman/files/connman.initd2 b/net-misc/connman/files/connman.initd2
new file mode 100644
index 0000000..7b14d07
--- /dev/null
+++ b/net-misc/connman/files/connman.initd2
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Purpose License v2
+# $Id$
+
+depend() {
+ need dbus
+ provide net
+}
+
+start() {
+ ebegin "Starting Connection Manager"
+ start-stop-daemon --start --quiet --exec /usr/sbin/connmand -- ${CONNMAN_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Connection Manager"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/connmand
+ eend $?
+}
+
+# vim: set ft=gentoo-init-d ts=3 sw=3 et:
diff --git a/net-misc/connman/files/connman.service b/net-misc/connman/files/connman.service
new file mode 100644
index 0000000..ece38a7
--- /dev/null
+++ b/net-misc/connman/files/connman.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Network Connection Manager Daemon
+
+[Service]
+Type=dbus
+BusName=net.connman
+ExecStart=/usr/sbin/connmand --nodaemon
+
+[Install]
+WantedBy=multi-user.target
+Alias=net.connman.service