diff options
Diffstat (limited to 'meta/recipes-connectivity/connman/connman')
5 files changed, 266 insertions, 509 deletions
diff --git a/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch b/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch new file mode 100644 index 0000000000..8012606db7 --- /dev/null +++ b/meta/recipes-connectivity/connman/connman/0001-src-log.c-Include-libgen.h-for-basename-API.patch @@ -0,0 +1,55 @@ +From cbba6638986c2de763981bf6fc59df6a86fed44f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 1 Jan 2024 17:42:21 -0800 +Subject: [PATCH v2] src/log.c: Include libgen.h for basename API + +Use POSIX version of basename. This comes to front with latest musl +which dropped the declaration from string.h [1] it fails to build with +clang-17+ because it treats implicit function declaration as error. + +Fix it by applying the basename on a copy of string since posix version +may modify the input string. + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://lore.kernel.org/connman/20240102015917.3732089-1-raj.khem@gmail.com/T/#u] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + + src/log.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/log.c b/src/log.c +index 554b046..2df3af7 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -24,6 +24,7 @@ + #endif + + #include <stdio.h> ++#include <libgen.h> + #include <unistd.h> + #include <stdarg.h> + #include <stdlib.h> +@@ -196,6 +197,7 @@ int __connman_log_init(const char *program, const char *debug, + const char *program_name, const char *program_version) + { + static char path[PATH_MAX]; ++ char* tmp = strdup(program); + int option = LOG_NDELAY | LOG_PID; + + program_exec = program; +@@ -212,8 +214,8 @@ int __connman_log_init(const char *program, const char *debug, + if (backtrace) + signal_setup(signal_handler); + +- openlog(basename(program), option, LOG_DAEMON); +- ++ openlog(basename(tmp), option, LOG_DAEMON); ++ free(tmp); + syslog(LOG_INFO, "%s version %s", program_name, program_version); + + return 0; +-- +2.43.0 + diff --git a/meta/recipes-connectivity/connman/connman/0001-vpn-Adding-support-for-latest-pppd-2.5.0-release.patch b/meta/recipes-connectivity/connman/connman/0001-vpn-Adding-support-for-latest-pppd-2.5.0-release.patch new file mode 100644 index 0000000000..9e5ac8da15 --- /dev/null +++ b/meta/recipes-connectivity/connman/connman/0001-vpn-Adding-support-for-latest-pppd-2.5.0-release.patch @@ -0,0 +1,152 @@ +From af55a6a414d32c12f9ef3cab778385a361e1ad6d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Eivind=20N=C3=A6ss?= <eivnaes@yahoo.com> +Date: Sat, 25 Mar 2023 20:51:52 +0000 +Subject: [PATCH] vpn: Adding support for latest pppd 2.5.0 release + +The API has gone through a significant overhaul, and this change fixes any compile issues. +1) Fixes to configure.ac itself +2) Cleanup in pppd plugin itself + +Adding a libppp-compat.h file to mask for any differences in the version. + +Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=a48864a2e5d2a725dfc6eef567108bc13b43857f] +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- + scripts/libppp-compat.h | 127 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 127 insertions(+) + create mode 100644 scripts/libppp-compat.h + +diff --git a/scripts/libppp-compat.h b/scripts/libppp-compat.h +new file mode 100644 +index 0000000..eee1d09 +--- /dev/null ++++ b/scripts/libppp-compat.h +@@ -0,0 +1,127 @@ ++/* Copyright (C) Eivind Naess, eivnaes@yahoo.com */ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++ ++#ifndef __LIBPPP_COMPAT_H__ ++#define __LIBPPP_COMPAT_H__ ++ ++/* Define USE_EAPTLS compile with EAP TLS support against older pppd headers, ++ * pppd >= 2.5.0 use PPP_WITH_EAPTLS and is defined in pppdconf.h */ ++#define USE_EAPTLS 1 ++ ++/* Define INET6 to compile with IPv6 support against older pppd headers, ++ * pppd >= 2.5.0 use PPP_WITH_IPV6CP and is defined in pppdconf.h */ ++#define INET6 1 ++ ++/* PPP < 2.5.0 defines and exports VERSION which overlaps with current package VERSION define. ++ * this silly macro magic is to work around that. */ ++#undef VERSION ++#include <pppd/pppd.h> ++ ++#ifndef PPPD_VERSION ++#define PPPD_VERSION VERSION ++#endif ++ ++#include <pppd/fsm.h> ++#include <pppd/ccp.h> ++#include <pppd/eui64.h> ++#include <pppd/ipcp.h> ++#include <pppd/ipv6cp.h> ++#include <pppd/eap.h> ++#include <pppd/upap.h> ++ ++#ifdef HAVE_PPPD_CHAP_H ++#include <pppd/chap.h> ++#endif ++ ++#ifdef HAVE_PPPD_CHAP_NEW_H ++#include <pppd/chap-new.h> ++#endif ++ ++#ifdef HAVE_PPPD_CHAP_MS_H ++#include <pppd/chap_ms.h> ++#endif ++ ++#ifndef PPP_PROTO_CHAP ++#define PPP_PROTO_CHAP 0xc223 ++#endif ++ ++#ifndef PPP_PROTO_EAP ++#define PPP_PROTO_EAP 0xc227 ++#endif ++ ++ ++#if WITH_PPP_VERSION < PPP_VERSION(2,5,0) ++ ++static inline bool ++debug_on (void) ++{ ++ return debug; ++} ++ ++static inline const char ++*ppp_ipparam (void) ++{ ++ return ipparam; ++} ++ ++static inline int ++ppp_ifunit (void) ++{ ++ return ifunit; ++} ++ ++static inline const char * ++ppp_ifname (void) ++{ ++ return ifname; ++} ++ ++static inline int ++ppp_get_mtu (int idx) ++{ ++ return netif_get_mtu(idx); ++} ++ ++typedef enum ppp_notify ++{ ++ NF_PID_CHANGE, ++ NF_PHASE_CHANGE, ++ NF_EXIT, ++ NF_SIGNALED, ++ NF_IP_UP, ++ NF_IP_DOWN, ++ NF_IPV6_UP, ++ NF_IPV6_DOWN, ++ NF_AUTH_UP, ++ NF_LINK_DOWN, ++ NF_FORK, ++ NF_MAX_NOTIFY ++} ppp_notify_t; ++ ++typedef void (ppp_notify_fn) (void *ctx, int arg); ++ ++static inline void ++ppp_add_notify (ppp_notify_t type, ppp_notify_fn *func, void *ctx) ++{ ++ struct notifier **list[NF_MAX_NOTIFY] = { ++ [NF_PID_CHANGE ] = &pidchange, ++ [NF_PHASE_CHANGE] = &phasechange, ++ [NF_EXIT ] = &exitnotify, ++ [NF_SIGNALED ] = &sigreceived, ++ [NF_IP_UP ] = &ip_up_notifier, ++ [NF_IP_DOWN ] = &ip_down_notifier, ++ [NF_IPV6_UP ] = &ipv6_up_notifier, ++ [NF_IPV6_DOWN ] = &ipv6_down_notifier, ++ [NF_AUTH_UP ] = &auth_up_notifier, ++ [NF_LINK_DOWN ] = &link_down_notifier, ++ [NF_FORK ] = &fork_notifier, ++ }; ++ ++ struct notifier **notify = list[type]; ++ if (notify) { ++ add_notifier(notify, func, ctx); ++ } ++} ++ ++#endif /* #if WITH_PPP_VERSION < PPP_VERSION(2,5,0) */ ++#endif /* #if__LIBPPP_COMPAT_H__ */ diff --git a/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch b/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch index 0593427710..9e2cc34995 100644 --- a/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch +++ b/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch @@ -1,77 +1,88 @@ -From 10b0d16d04b811b1ccd1f9b0cfe757bce8d876a1 Mon Sep 17 00:00:00 2001 +From 60783f0d885c9a0db8b6f1d528786321e53f1512 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 6 Apr 2015 23:02:21 -0700 -Subject: [PATCH 2/3] resolve: musl does not implement res_ninit +Subject: [PATCH] gweb/gresolv.c: make use of res_ninit optional and subject to + __RES -ported from +Not all libc implementation have those functions, and the way to determine +if they do is to check __RES which is explained in resolv.h thusly: + +/* + * Revision information. This is the release date in YYYYMMDD format. + * It can change every day so the right thing to do with it is use it + * in preprocessor commands such as "#if (__RES > 19931104)". Do not + * compare for equality; rather, use it to determine whether your resolver + * is new enough to contain a certain feature. + */ + +Indeed, it needs to be at least 19991006. + +The portion of the patch that implements a fallback is ported from +Alpine Linux: http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch -Upstream-Status: Pending +Upstream-Status: Submitted [to connman@lists.linux.dev,marcel@holtmann.org] Signed-off-by: Khem Raj <raj.khem@gmail.com> --- - gweb/gresolv.c | 33 ++++++++++++--------------------- - 1 file changed, 12 insertions(+), 21 deletions(-) + gweb/gresolv.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) diff --git a/gweb/gresolv.c b/gweb/gresolv.c -index 5cf7a9a..3ad8e70 100644 +index 8101d71..9f1477c 100644 --- a/gweb/gresolv.c +++ b/gweb/gresolv.c -@@ -875,8 +875,6 @@ GResolv *g_resolv_new(int index) +@@ -879,7 +879,9 @@ GResolv *g_resolv_new(int index) resolv->index = index; resolv->nameserver_list = NULL; -- res_ninit(&resolv->res); -- ++#if (__RES >= 19991006) + res_ninit(&resolv->res); ++#endif + return resolv; } - -@@ -916,8 +914,6 @@ void g_resolv_unref(GResolv *resolv) +@@ -920,7 +922,9 @@ void g_resolv_unref(GResolv *resolv) flush_nameservers(resolv); -- res_nclose(&resolv->res); -- ++#if (__RES >= 19991006) + res_nclose(&resolv->res); ++#endif + g_free(resolv); } - -@@ -1020,24 +1016,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, +@@ -1024,6 +1028,7 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, 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 (__RES >= 19991006) + int i; + + for (i = 0; i < resolv->res.nscount; i++) { +@@ -1043,6 +1048,22 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, + if (inet_ntop(family, sa_addr, buf, sizeof(buf))) + g_resolv_add_nameserver(resolv, buf, 53, 0); } ++#else ++ 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); ++ } ++ fclose(f); ++ } ++#endif if (!resolv->nameserver_list) + g_resolv_add_nameserver(resolv, "127.0.0.1", 53, 0); -- -2.5.1 +2.39.2 diff --git a/meta/recipes-connectivity/connman/connman/connman b/meta/recipes-connectivity/connman/connman/connman index c64fa0d715..a021fd4655 100644 --- a/meta/recipes-connectivity/connman/connman/connman +++ b/meta/recipes-connectivity/connman/connman/connman @@ -10,49 +10,11 @@ fi set -e -nfsroot=0 - -exec 9<&0 < /proc/mounts -while read dev mtpt fstype rest; do - if test $mtpt = "/" ; then - case $fstype in - nfs | nfs4) - nfsroot=1 - break - ;; - *) - ;; - esac - fi -done - do_start() { - EXTRA_PARAM="" - if test $nfsroot -eq 1 ; then - NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'` - NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'` - - if [ ! -z "$NET_ADDR" ]; then - if [ "$NET_ADDR" = dhcp ]; then - ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"` - if [ ! -z "$ethn" ]; then - EXTRA_PARAM="-I $ethn" - fi - else - for i in $NET_DEVS; do - ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'` - if [ "$NET_ADDR" = "$ADDR" ]; then - EXTRA_PARAM="-I $i" - break - fi - done - fi - fi - fi if [ -f @DATADIR@/connman/wired-setup ] ; then . @DATADIR@/connman/wired-setup fi - $DAEMON $EXTRA_PARAM + $DAEMON } do_stop() { diff --git a/meta/recipes-connectivity/connman/connman/includes.patch b/meta/recipes-connectivity/connman/connman/includes.patch deleted file mode 100644 index 55cb187931..0000000000 --- a/meta/recipes-connectivity/connman/connman/includes.patch +++ /dev/null @@ -1,423 +0,0 @@ -Fix various issues which cause problems under musl. - -Upstream-Status: Submitted -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From 630516bcc0233b047f65665c003201ba6e77453d Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Tue, 9 Aug 2016 16:22:36 +0100 -Subject: [PATCH 1/3] Use AC_USE_SYSTEM_EXTENSIONS - -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 - - -From b8b7878e6cb2a1ed4fcfa256f7e232511a40e3d9 Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Tue, 9 Aug 2016 15:37:50 +0100 -Subject: [PATCH 2/3] Check for in6_pktinfo.ipi6_addr explicitly - -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 <raj.khem@gmail.com>. ---- - 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 - - -From c0726e432fa0274a2b9c70179b03df6720972816 Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Tue, 9 Aug 2016 15:19:23 +0100 -Subject: [PATCH 3/3] Rationalise includes - -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 <raj.khem@gmail.com>. ---- - 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 |