diff options
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-connectivity/connman/connman')
4 files changed, 101 insertions, 166 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch deleted file mode 100644 index bf3b86d86..000000000 --- a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-Fix-compile-on-musl-with-kernel-4.9-headers.patch +++ /dev/null @@ -1,64 +0,0 @@ -From c8bfad4ee9d2c505c00ccbb8b2139543b5ad6fcb Mon Sep 17 00:00:00 2001 -From: Jussi Kukkonen <jussi.kukkonen@intel.com> -Date: Mon, 23 Jan 2017 17:41:39 +0200 -Subject: [PATCH] Fix compile on musl with kernel 4.9 headers - -Kernel headers break when musl defines IFF_LOWER_UP. While -waiting for more proper fix in musl, add a hack to connman. - -Upstream-Status: Inappropriate [Workaround] -Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> ---- - src/6to4.c | 4 ++++ - src/firewall.c | 4 ++++ - src/iptables.c | 4 ++++ - 3 files changed, 12 insertions(+) - -diff --git a/src/6to4.c b/src/6to4.c -index 71a2882..1938afb 100644 ---- a/src/6to4.c -+++ b/src/6to4.c -@@ -24,6 +24,10 @@ - #include <config.h> - #endif - -+/* hack to make sure kernel headers understand that libc (musl) -+ does define IFF_LOWER_UP et al. */ -+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 -+ - #include <errno.h> - #include <stdio.h> - #include <stdlib.h> -diff --git a/src/firewall.c b/src/firewall.c -index c440df6..c83def9 100644 ---- a/src/firewall.c -+++ b/src/firewall.c -@@ -23,6 +23,10 @@ - #include <config.h> - #endif - -+/* hack to make sure kernel headers understand that libc (musl) -+ does define IFF_LOWER_UP et al. */ -+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 -+ - #include <errno.h> - - #include <xtables.h> -diff --git a/src/iptables.c b/src/iptables.c -index 82e3ac4..46ad9e2 100644 ---- a/src/iptables.c -+++ b/src/iptables.c -@@ -23,6 +23,10 @@ - #include <config.h> - #endif - -+/* hack to make sure kernel headers understand that libc (musl) -+ does define IFF_LOWER_UP et al. */ -+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 -+ - #include <getopt.h> - #include <stdlib.h> - #include <stdio.h> --- -2.1.4 - diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch new file mode 100644 index 000000000..8e2e0bd02 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch @@ -0,0 +1,29 @@ +From 9f70b94ebf18f52c115634642652830fa77f27a1 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Mon, 12 Jun 2017 16:52:39 +0300 +Subject: [PATCH] connman.service: stop systemd-resolved when we use connman + +Stop systemd-resolved service when we use connman as network manager. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + src/connman.service.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/connman.service.in b/src/connman.service.in +index 9f5c10f..dab48bc 100644 +--- a/src/connman.service.in ++++ b/src/connman.service.in +@@ -6,6 +6,7 @@ RequiresMountsFor=@localstatedir@/lib/connman + After=dbus.service network-pre.target systemd-sysusers.service + Before=network.target multi-user.target shutdown.target + Wants=network.target ++Conflicts=systemd-resolved.service + + [Service] + Type=dbus +-- +2.4.0 + diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch new file mode 100644 index 000000000..cfafbd127 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0001-firewall-nftables-fix-build-with-libnftnl-1.0.7.patch @@ -0,0 +1,72 @@ +From 4058ce3186a99fd5f03350fc11a7fc8d38b6a381 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Mon, 8 May 2017 10:53:18 +0300 +Subject: [PATCH] firewall-nftables: fix build with libnftnl-1.0.7 + +We need these updates to accommodate the changes caused by the following +commit in libnftnl-1.0.7 + +commit 907a9f8e5a93f5bcd449643eb3916a656d634758 +Author: Pablo Neira Ayuso <pablo@netfilter.org> +Date: Tue Dec 20 13:47:11 2016 +0100 + +src: get rid of aliases and compat + +This machinery was introduced to avoid sudden compilation breakage of +old nftables releases. With the upcoming release of 0.7 (and 0.6 which +is now 6 months old) this is not required anymore. + +Moreover, users gain nothing from older releases since they are +half-boiled and buggy. + +So let's get rid of aliases now. Bump LIBVERSION and update map file. + +Upstream-Status: Submitted + +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + src/firewall-nftables.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/firewall-nftables.c b/src/firewall-nftables.c +index 583d1c4..83b137b 100644 +--- a/src/firewall-nftables.c ++++ b/src/firewall-nftables.c +@@ -387,9 +387,9 @@ static int add_cmp(struct nftnl_rule *rule, uint32_t sreg, uint32_t op, + if (!expr) + return -ENOMEM; + +- nftnl_expr_set_u32(expr, NFT_EXPR_CMP_SREG, sreg); +- nftnl_expr_set_u32(expr, NFT_EXPR_CMP_OP, op); +- nftnl_expr_set(expr, NFT_EXPR_CMP_DATA, data, data_len); ++ nftnl_expr_set_u32(expr, NFTNL_EXPR_CMP_SREG, sreg); ++ nftnl_expr_set_u32(expr, NFTNL_EXPR_CMP_OP, op); ++ nftnl_expr_set(expr, NFTNL_EXPR_CMP_DATA, data, data_len); + + nftnl_rule_add_expr(rule, expr); + +@@ -575,8 +575,8 @@ static int build_rule_nat(const char *address, unsigned char prefixlen, + expr = nftnl_expr_alloc("meta"); + if (!expr) + goto err; +- nftnl_expr_set_u32(expr, NFT_EXPR_META_KEY, NFT_META_OIFNAME); +- nftnl_expr_set_u32(expr, NFT_EXPR_META_DREG, NFT_REG_1); ++ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_KEY, NFT_META_OIFNAME); ++ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_DREG, NFT_REG_1); + nftnl_rule_add_expr(rule, expr); + err = add_cmp(rule, NFT_REG_1, NFT_CMP_EQ, interface, + strlen(interface) + 1); +@@ -677,8 +677,8 @@ static int build_rule_snat(int index, const char *address, + expr = nftnl_expr_alloc("meta"); + if (!expr) + goto err; +- nftnl_expr_set_u32(expr, NFT_EXPR_META_KEY, NFT_META_OIF); +- nftnl_expr_set_u32(expr, NFT_EXPR_META_DREG, NFT_REG_1); ++ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_KEY, NFT_META_OIF); ++ nftnl_expr_set_u32(expr, NFTNL_EXPR_META_DREG, NFT_REG_1); + nftnl_rule_add_expr(rule, expr); + err = add_cmp(rule, NFT_REG_1, NFT_CMP_EQ, &index, sizeof(index)); + if (err < 0) +-- +2.4.0 + diff --git a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0003-stats-Fix-bad-file-descriptor-initialisation.patch b/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0003-stats-Fix-bad-file-descriptor-initialisation.patch deleted file mode 100644 index c545811ee..000000000 --- a/import-layers/yocto-poky/meta/recipes-connectivity/connman/connman/0003-stats-Fix-bad-file-descriptor-initialisation.patch +++ /dev/null @@ -1,102 +0,0 @@ -From c7f4151fb053b0d0691d8f10d7e3690265d28889 Mon Sep 17 00:00:00 2001 -From: Lukasz Nowak <lnowak@tycoint.com> -Date: Wed, 26 Oct 2016 18:13:02 +0100 -Subject: [PATCH] stats: Fix bad file descriptor initialisation - -Stats file code initialises its file descriptor field to 0. But 0 is -a valid fd value. -1 should be used instead. This causes problems -when an error happens before a stats file is open (e.g. mkdir -fails). The clean-up procedure, stats_free() calls close(fd). When fd -is 0, this first closes stdin, and then any files/sockets which -received fd=0, re-used by the OS. - -Fixed several instances of bad file descriptor field handling, in case -of errors. - -The bug results with connman freezing if there is no read/write storage -directory available, and there are multiple active interfaces -(fd=0 gets re-used for sockets in that case). - -The patch was imported from the Connman git repository -(git://git.kernel.org/pub/scm/network/connman) as of commit id -c7f4151fb053b0d0691d8f10d7e3690265d28889. - -Upstream-Status: Accepted -Signed-off-by: Lukasz Nowak <lnowak@tycoint.com> ---- - src/stats.c | 15 +++++++++++++++ - src/util.c | 4 ++-- - 2 files changed, 17 insertions(+), 2 deletions(-) - -diff --git a/src/stats.c b/src/stats.c -index 26343b1..c3ca738 100644 ---- a/src/stats.c -+++ b/src/stats.c -@@ -378,6 +378,7 @@ static int stats_file_setup(struct stats_file *file) - strerror(errno), file->name); - - TFR(close(file->fd)); -+ file->fd = -1; - g_free(file->name); - file->name = NULL; - -@@ -393,6 +394,7 @@ static int stats_file_setup(struct stats_file *file) - err = stats_file_remap(file, size); - if (err < 0) { - TFR(close(file->fd)); -+ file->fd = -1; - g_free(file->name); - file->name = NULL; - -@@ -649,6 +651,13 @@ static int stats_file_history_update(struct stats_file *data_file) - bzero(history_file, sizeof(struct stats_file)); - bzero(temp_file, sizeof(struct stats_file)); - -+ /* -+ * 0 is a valid file descriptor - fd needs to be initialized -+ * to -1 to handle errors correctly -+ */ -+ history_file->fd = -1; -+ temp_file->fd = -1; -+ - err = stats_open(history_file, data_file->history_name); - if (err < 0) - return err; -@@ -682,6 +691,12 @@ int __connman_stats_service_register(struct connman_service *service) - if (!file) - return -ENOMEM; - -+ /* -+ * 0 is a valid file descriptor - fd needs to be initialized -+ * to -1 to handle errors correctly -+ */ -+ file->fd = -1; -+ - g_hash_table_insert(stats_hash, service, file); - } else { - return -EALREADY; -diff --git a/src/util.c b/src/util.c -index e6532c8..732d451 100644 ---- a/src/util.c -+++ b/src/util.c -@@ -63,7 +63,7 @@ int __connman_util_init(void) - { - int r = 0; - -- if (f > 0) -+ if (f >= 0) - return 0; - - f = open(URANDOM, O_RDONLY); -@@ -86,7 +86,7 @@ int __connman_util_init(void) - - void __connman_util_cleanup(void) - { -- if (f > 0) -+ if (f >= 0) - close(f); - - f = -1; --- -2.7.4 - |