All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] connman: add patch to fix build with headers >= 4.5
@ 2016-04-14 14:24 Gustavo Zacarias
  2016-04-15  7:56 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo Zacarias @ 2016-04-14 14:24 UTC (permalink / raw)
  To: buildroot

Add a patch from Gentoo that fixes the build on linux headers >= 4.5
The probem arises from an incompatibility in newer headers when both
net/if.h and linux/if.h are included in the same source.
See https://bugs.gentoo.org/show_bug.cgi?id=577584

Fixes:
http://autobuild.buildroot.net/results/48e/48e6f34a7940f52d987db47784c0d9e82f39de7c/

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/connman/0003-xtables.patch | 61 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 package/connman/0003-xtables.patch

diff --git a/package/connman/0003-xtables.patch b/package/connman/0003-xtables.patch
new file mode 100644
index 0000000..277fce6
--- /dev/null
+++ b/package/connman/0003-xtables.patch
@@ -0,0 +1,61 @@
+Use some preprocessor tricks to route around incompatibilies seen
+between newer Linux kernels and glibc when both net/if.h and linux/if.h
+are included in the same source.
+
+Patch from gentoo, see https://bugs.gentoo.org/show_bug.cgi?id=577584
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+--- 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,20 @@
++#ifndef CONNMAN_XTABLES_H
++#define CONNMAN_XTABLES_H
++
++#include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 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
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] connman: add patch to fix build with headers >= 4.5
  2016-04-14 14:24 [Buildroot] [PATCH] connman: add patch to fix build with headers >= 4.5 Gustavo Zacarias
@ 2016-04-15  7:56 ` Thomas Petazzoni
  2016-04-15 12:39   ` Gustavo Zacarias
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2016-04-15  7:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 14 Apr 2016 11:24:03 -0300, Gustavo Zacarias wrote:
> Add a patch from Gentoo that fixes the build on linux headers >= 4.5
> The probem arises from an incompatibility in newer headers when both
> net/if.h and linux/if.h are included in the same source.
> See https://bugs.gentoo.org/show_bug.cgi?id=577584
> 
> Fixes:
> http://autobuild.buildroot.net/results/48e/48e6f34a7940f52d987db47784c0d9e82f39de7c/
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>  package/connman/0003-xtables.patch | 61 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 package/connman/0003-xtables.patch

Applied, thanks! I guess it's the same problem as the one affecting
strongswan, which was recently resolved by disabling iptables support.
Correct? If you have a better fix for strongswan, feel free to submit
it.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] connman: add patch to fix build with headers >= 4.5
  2016-04-15  7:56 ` Thomas Petazzoni
@ 2016-04-15 12:39   ` Gustavo Zacarias
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2016-04-15 12:39 UTC (permalink / raw)
  To: buildroot

On 15/04/16 04:56, Thomas Petazzoni wrote:

> Applied, thanks! I guess it's the same problem as the one affecting
> strongswan, which was recently resolved by disabling iptables support.
> Correct? If you have a better fix for strongswan, feel free to submit
> it.
>
> Thanks!
>
> Thomas

Hi.
Yes, it's very similar in nature, however from strongswan it's not a 
huge show-stopper, whereas for connman you can't build without it.
I'll take a look a strongswan shortly, the solution is probably just 
adapting this patch.
Regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-15 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 14:24 [Buildroot] [PATCH] connman: add patch to fix build with headers >= 4.5 Gustavo Zacarias
2016-04-15  7:56 ` Thomas Petazzoni
2016-04-15 12:39   ` Gustavo Zacarias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.