summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman
diff options
context:
space:
mode:
authorMaxin B. John <maxin.john@intel.com>2017-05-08 11:46:57 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-23 16:45:36 (GMT)
commit29c426b8860b3a8eaf0e7862875a756ec7cc25bf (patch)
tree40c48ebd1bbdf245e51f19050b97e227e31307b4 /meta/recipes-connectivity/connman
parent1fe39e849299a720ab0bcace7d6d8325e6cd8193 (diff)
downloadpoky-29c426b8860b3a8eaf0e7862875a756ec7cc25bf.tar.gz
connman: upgrade to 1.34
1.33 -> 1.34 1. Refreshed 0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch 2. Removed upstreamed patch: 0003-stats-Fix-bad-file-descriptor-initialisation.patch 3. Provided PACKAGECONFIGs for nftables and iptables support 4. Add new patch to fix build with nftables: 0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch (From OE-Core rev: dfe40b7abbea36605e4ea8f74ec8e477505148a6) Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/connman')
-rw-r--r--meta/recipes-connectivity/connman/connman.inc5
-rw-r--r--meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch37
-rw-r--r--meta/recipes-connectivity/connman/connman/0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch72
-rw-r--r--meta/recipes-connectivity/connman/connman/0003-stats-Fix-bad-file-descriptor-initialisation.patch102
-rw-r--r--meta/recipes-connectivity/connman/connman_1.34.bb (renamed from meta/recipes-connectivity/connman/connman_1.33.bb)6
5 files changed, 106 insertions, 116 deletions
diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index 64a5418..cc2d469 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -15,7 +15,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
15 15
16inherit autotools pkgconfig systemd update-rc.d bluetooth 16inherit autotools pkgconfig systemd update-rc.d bluetooth
17 17
18DEPENDS = "dbus glib-2.0 ppp iptables readline" 18DEPENDS = "dbus glib-2.0 ppp readline"
19 19
20INC_PR = "r20" 20INC_PR = "r20"
21 21
@@ -33,6 +33,7 @@ EXTRA_OECONF += "\
33PACKAGECONFIG ??= "wispr \ 33PACKAGECONFIG ??= "wispr \
34 ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \ 34 ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
35 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ 35 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
36 iptables \
36" 37"
37 38
38# If you want ConnMan to support VPN, add following statement into 39# If you want ConnMan to support VPN, add following statement into
@@ -50,6 +51,8 @@ PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2t
50PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux" 51PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
51# WISPr support for logging into hotspots, requires TLS 52# WISPr support for logging into hotspots, requires TLS
52PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls," 53PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
54PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,nftables,nftables"
55PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"
53 56
54INITSCRIPT_NAME = "connman" 57INITSCRIPT_NAME = "connman"
55INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." 58INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
diff --git a/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch b/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch
index bf3b86d..da5756e 100644
--- a/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch
+++ b/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch
@@ -1,4 +1,4 @@
1From c8bfad4ee9d2c505c00ccbb8b2139543b5ad6fcb Mon Sep 17 00:00:00 2001 1From 594b67df7ca923d13265906a71fbbf748273a5f5 Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com> 2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Mon, 23 Jan 2017 17:41:39 +0200 3Date: Mon, 23 Jan 2017 17:41:39 +0200
4Subject: [PATCH] Fix compile on musl with kernel 4.9 headers 4Subject: [PATCH] Fix compile on musl with kernel 4.9 headers
@@ -7,12 +7,15 @@ Kernel headers break when musl defines IFF_LOWER_UP. While
7waiting for more proper fix in musl, add a hack to connman. 7waiting for more proper fix in musl, add a hack to connman.
8 8
9Upstream-Status: Inappropriate [Workaround] 9Upstream-Status: Inappropriate [Workaround]
10
10Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> 11Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
12Signed-off-by: Maxin B. John <maxin.john@intel.com>
11--- 13---
12 src/6to4.c | 4 ++++ 14 src/6to4.c | 4 ++++
13 src/firewall.c | 4 ++++ 15 src/firewall-iptables.c | 4 ++++
14 src/iptables.c | 4 ++++ 16 src/firewall-nftables.c | 3 +++
15 3 files changed, 12 insertions(+) 17 src/iptables.c | 4 ++++
18 4 files changed, 15 insertions(+)
16 19
17diff --git a/src/6to4.c b/src/6to4.c 20diff --git a/src/6to4.c b/src/6to4.c
18index 71a2882..1938afb 100644 21index 71a2882..1938afb 100644
@@ -29,10 +32,10 @@ index 71a2882..1938afb 100644
29 #include <errno.h> 32 #include <errno.h>
30 #include <stdio.h> 33 #include <stdio.h>
31 #include <stdlib.h> 34 #include <stdlib.h>
32diff --git a/src/firewall.c b/src/firewall.c 35diff --git a/src/firewall-iptables.c b/src/firewall-iptables.c
33index c440df6..c83def9 100644 36index 45943a8..e04bb91 100644
34--- a/src/firewall.c 37--- a/src/firewall-iptables.c
35+++ b/src/firewall.c 38+++ b/src/firewall-iptables.c
36@@ -23,6 +23,10 @@ 39@@ -23,6 +23,10 @@
37 #include <config.h> 40 #include <config.h>
38 #endif 41 #endif
@@ -44,6 +47,20 @@ index c440df6..c83def9 100644
44 #include <errno.h> 47 #include <errno.h>
45 48
46 #include <xtables.h> 49 #include <xtables.h>
50diff --git a/src/firewall-nftables.c b/src/firewall-nftables.c
51index 2503ee2..583d1c4 100644
52--- a/src/firewall-nftables.c
53+++ b/src/firewall-nftables.c
54@@ -30,6 +30,9 @@
55 #ifdef HAVE_CONFIG_H
56 #include <config.h>
57 #endif
58+/* hack to make sure kernel headers understand that libc (musl)
59+ does define IFF_LOWER_UP et al. */
60+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
61
62 #include <stdlib.h>
63 #include <time.h>
47diff --git a/src/iptables.c b/src/iptables.c 64diff --git a/src/iptables.c b/src/iptables.c
48index 82e3ac4..46ad9e2 100644 65index 82e3ac4..46ad9e2 100644
49--- a/src/iptables.c 66--- a/src/iptables.c
@@ -60,5 +77,5 @@ index 82e3ac4..46ad9e2 100644
60 #include <stdlib.h> 77 #include <stdlib.h>
61 #include <stdio.h> 78 #include <stdio.h>
62-- 79--
632.1.4 802.4.0
64 81
diff --git a/meta/recipes-connectivity/connman/connman/0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch b/meta/recipes-connectivity/connman/connman/0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch
new file mode 100644
index 0000000..cfafbd1
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch
@@ -0,0 +1,72 @@
1From 4058ce3186a99fd5f03350fc11a7fc8d38b6a381 Mon Sep 17 00:00:00 2001
2From: "Maxin B. John" <maxin.john@intel.com>
3Date: Mon, 8 May 2017 10:53:18 +0300
4Subject: [PATCH] firewall-nftables: fix build with libnftnl-1.0.7
5
6We need these updates to accommodate the changes caused by the following
7commit in libnftnl-1.0.7
8
9commit 907a9f8e5a93f5bcd449643eb3916a656d634758
10Author: Pablo Neira Ayuso <pablo@netfilter.org>
11Date: Tue Dec 20 13:47:11 2016 +0100
12
13src: get rid of aliases and compat
14
15This machinery was introduced to avoid sudden compilation breakage of
16old nftables releases. With the upcoming release of 0.7 (and 0.6 which
17is now 6 months old) this is not required anymore.
18
19Moreover, users gain nothing from older releases since they are
20half-boiled and buggy.
21
22So let's get rid of aliases now. Bump LIBVERSION and update map file.
23
24Upstream-Status: Submitted
25
26Signed-off-by: Maxin B. John <maxin.john@intel.com>
27---
28 src/firewall-nftables.c | 14 +++++++-------
29 1 file changed, 7 insertions(+), 7 deletions(-)
30
31diff --git a/src/firewall-nftables.c b/src/firewall-nftables.c
32index 583d1c4..83b137b 100644
33--- a/src/firewall-nftables.c
34+++ b/src/firewall-nftables.c
35@@ -387,9 +387,9 @@ static int add_cmp(struct nftnl_rule *rule, uint32_t sreg, uint32_t op,
36 if (!expr)
37 return -ENOMEM;
38
39- nftnl_expr_set_u32(expr, NFT_EXPR_CMP_SREG, sreg);
40- nftnl_expr_set_u32(expr, NFT_EXPR_CMP_OP, op);
41- nftnl_expr_set(expr, NFT_EXPR_CMP_DATA, data, data_len);
42+ nftnl_expr_set_u32(expr, NFTNL_EXPR_CMP_SREG, sreg);
43+ nftnl_expr_set_u32(expr, NFTNL_EXPR_CMP_OP, op);
44+ nftnl_expr_set(expr, NFTNL_EXPR_CMP_DATA, data, data_len);
45
46 nftnl_rule_add_expr(rule, expr);
47
48@@ -575,8 +575,8 @@ static int build_rule_nat(const char *address, unsigned char prefixlen,
49 expr = nftnl_expr_alloc("meta");
50 if (!expr)
51 goto err;
52- nftnl_expr_set_u32(expr, NFT_EXPR_META_KEY, NFT_META_OIFNAME);
53- nftnl_expr_set_u32(expr, NFT_EXPR_META_DREG, NFT_REG_1);
54+ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_KEY, NFT_META_OIFNAME);
55+ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_DREG, NFT_REG_1);
56 nftnl_rule_add_expr(rule, expr);
57 err = add_cmp(rule, NFT_REG_1, NFT_CMP_EQ, interface,
58 strlen(interface) + 1);
59@@ -677,8 +677,8 @@ static int build_rule_snat(int index, const char *address,
60 expr = nftnl_expr_alloc("meta");
61 if (!expr)
62 goto err;
63- nftnl_expr_set_u32(expr, NFT_EXPR_META_KEY, NFT_META_OIF);
64- nftnl_expr_set_u32(expr, NFT_EXPR_META_DREG, NFT_REG_1);
65+ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_KEY, NFT_META_OIF);
66+ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_DREG, NFT_REG_1);
67 nftnl_rule_add_expr(rule, expr);
68 err = add_cmp(rule, NFT_REG_1, NFT_CMP_EQ, &index, sizeof(index));
69 if (err < 0)
70--
712.4.0
72
diff --git a/meta/recipes-connectivity/connman/connman/0003-stats-Fix-bad-file-descriptor-initialisation.patch b/meta/recipes-connectivity/connman/connman/0003-stats-Fix-bad-file-descriptor-initialisation.patch
deleted file mode 100644
index c545811..0000000
--- a/meta/recipes-connectivity/connman/connman/0003-stats-Fix-bad-file-descriptor-initialisation.patch
+++ /dev/null
@@ -1,102 +0,0 @@
1From c7f4151fb053b0d0691d8f10d7e3690265d28889 Mon Sep 17 00:00:00 2001
2From: Lukasz Nowak <lnowak@tycoint.com>
3Date: Wed, 26 Oct 2016 18:13:02 +0100
4Subject: [PATCH] stats: Fix bad file descriptor initialisation
5
6Stats file code initialises its file descriptor field to 0. But 0 is
7a valid fd value. -1 should be used instead. This causes problems
8when an error happens before a stats file is open (e.g. mkdir
9fails). The clean-up procedure, stats_free() calls close(fd). When fd
10is 0, this first closes stdin, and then any files/sockets which
11received fd=0, re-used by the OS.
12
13Fixed several instances of bad file descriptor field handling, in case
14of errors.
15
16The bug results with connman freezing if there is no read/write storage
17directory available, and there are multiple active interfaces
18(fd=0 gets re-used for sockets in that case).
19
20The patch was imported from the Connman git repository
21(git://git.kernel.org/pub/scm/network/connman) as of commit id
22c7f4151fb053b0d0691d8f10d7e3690265d28889.
23
24Upstream-Status: Accepted
25Signed-off-by: Lukasz Nowak <lnowak@tycoint.com>
26---
27 src/stats.c | 15 +++++++++++++++
28 src/util.c | 4 ++--
29 2 files changed, 17 insertions(+), 2 deletions(-)
30
31diff --git a/src/stats.c b/src/stats.c
32index 26343b1..c3ca738 100644
33--- a/src/stats.c
34+++ b/src/stats.c
35@@ -378,6 +378,7 @@ static int stats_file_setup(struct stats_file *file)
36 strerror(errno), file->name);
37
38 TFR(close(file->fd));
39+ file->fd = -1;
40 g_free(file->name);
41 file->name = NULL;
42
43@@ -393,6 +394,7 @@ static int stats_file_setup(struct stats_file *file)
44 err = stats_file_remap(file, size);
45 if (err < 0) {
46 TFR(close(file->fd));
47+ file->fd = -1;
48 g_free(file->name);
49 file->name = NULL;
50
51@@ -649,6 +651,13 @@ static int stats_file_history_update(struct stats_file *data_file)
52 bzero(history_file, sizeof(struct stats_file));
53 bzero(temp_file, sizeof(struct stats_file));
54
55+ /*
56+ * 0 is a valid file descriptor - fd needs to be initialized
57+ * to -1 to handle errors correctly
58+ */
59+ history_file->fd = -1;
60+ temp_file->fd = -1;
61+
62 err = stats_open(history_file, data_file->history_name);
63 if (err < 0)
64 return err;
65@@ -682,6 +691,12 @@ int __connman_stats_service_register(struct connman_service *service)
66 if (!file)
67 return -ENOMEM;
68
69+ /*
70+ * 0 is a valid file descriptor - fd needs to be initialized
71+ * to -1 to handle errors correctly
72+ */
73+ file->fd = -1;
74+
75 g_hash_table_insert(stats_hash, service, file);
76 } else {
77 return -EALREADY;
78diff --git a/src/util.c b/src/util.c
79index e6532c8..732d451 100644
80--- a/src/util.c
81+++ b/src/util.c
82@@ -63,7 +63,7 @@ int __connman_util_init(void)
83 {
84 int r = 0;
85
86- if (f > 0)
87+ if (f >= 0)
88 return 0;
89
90 f = open(URANDOM, O_RDONLY);
91@@ -86,7 +86,7 @@ int __connman_util_init(void)
92
93 void __connman_util_cleanup(void)
94 {
95- if (f > 0)
96+ if (f >= 0)
97 close(f);
98
99 f = -1;
100--
1012.7.4
102
diff --git a/meta/recipes-connectivity/connman/connman_1.33.bb b/meta/recipes-connectivity/connman/connman_1.34.bb
index 4129b05..5d0f242 100644
--- a/meta/recipes-connectivity/connman/connman_1.33.bb
+++ b/meta/recipes-connectivity/connman/connman_1.34.bb
@@ -2,15 +2,15 @@ require connman.inc
2 2
3SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ 3SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
4 file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \ 4 file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \
5 file://0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch \
5 file://connman \ 6 file://connman \
6 file://no-version-scripts.patch \ 7 file://no-version-scripts.patch \
7 file://includes.patch \ 8 file://includes.patch \
8 file://0003-stats-Fix-bad-file-descriptor-initialisation.patch \
9 " 9 "
10SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch \ 10SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch \
11 file://0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch" 11 file://0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch"
12 12
13SRC_URI[md5sum] = "c51903fd3e7a6a371d12ac5d72a1fa01" 13SRC_URI[md5sum] = "e200028702c831d5f535d20d61e608ef"
14SRC_URI[sha256sum] = "bc8946036fa70124d663136f9f6b6238d897ca482782df907b07a428b09df5a0" 14SRC_URI[sha256sum] = "a9a0808c729c1f348fc36d8cecb52d19b72bc34cb411c502608cb0e0190fc71e"
15 15
16RRECOMMENDS_${PN} = "connman-conf" 16RRECOMMENDS_${PN} = "connman-conf"