Patchwork [iptables,2/3] android: Don't include conflicting headers

login
register
mail settings
Submitter Kevin Cernekee
Date Oct. 26, 2013, 6:50 p.m.
Message ID <1382813433-20890-3-git-send-email-cernekee@gmail.com>
Download mbox | patch
Permalink /patch/286301/
State Deferred
Headers show

Comments

Kevin Cernekee - Oct. 26, 2013, 6:50 p.m.
<netinet/ip.h> and <linux/ip.h> redefine a couple of structs, including
iphdr.  Handle this the same way as on glibc, i.e. don't include
<linux/ip.h>.

This change comes from AOSP.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 include/libiptc/ipt_kernel_headers.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Pablo Neira - Nov. 5, 2013, 1:02 p.m.
Hi Kevin,

On Sat, Oct 26, 2013 at 11:50:32AM -0700, Kevin Cernekee wrote:
> <netinet/ip.h> and <linux/ip.h> redefine a couple of structs, including
> iphdr.  Handle this the same way as on glibc, i.e. don't include
> <linux/ip.h>.
> 
> This change comes from AOSP.

No major objections to this 1/3 and 2/3, but I don't see this patch
here:

https://android.googlesource.com/platform/external/iptables/

Please, tell me if it's the right place to look at. Any plan to
include these patches to AOSP repositories?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Cernekee - Jan. 3, 2014, 1:28 a.m.
On Tue, Nov 5, 2013 at 5:02 AM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> Hi Kevin,
>
> On Sat, Oct 26, 2013 at 11:50:32AM -0700, Kevin Cernekee wrote:
>> <netinet/ip.h> and <linux/ip.h> redefine a couple of structs, including
>> iphdr.  Handle this the same way as on glibc, i.e. don't include
>> <linux/ip.h>.
>>
>> This change comes from AOSP.
>
> No major objections to this 1/3 and 2/3, but I don't see this patch
> here:
>
> https://android.googlesource.com/platform/external/iptables/
>
> Please, tell me if it's the right place to look at. Any plan to
> include these patches to AOSP repositories?

1/3 (socklen_t redefinition) is included here:

https://android.googlesource.com/platform/external/iptables/+/master/libiptc/libip4tc.c
https://android.googlesource.com/platform/external/iptables/+/master/libiptc/libip6tc.c

2/3 (conflicting ip.h headers) is included here:

https://android.googlesource.com/platform/external/iptables/+/master/include/libiptc/ipt_kernel_headers.h

For 3/3 (missing TCPOPT_* breaks the TCPOPTSTRIP module) I submitted a
patch to Bionic, and verified that it allows a successful build with
TCPOPTSTRIP enabled:

https://android-review.googlesource.com/#/c/73580/
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
index 18861fe..60c7998 100644
--- a/include/libiptc/ipt_kernel_headers.h
+++ b/include/libiptc/ipt_kernel_headers.h
@@ -5,7 +5,7 @@ 
 
 #include <limits.h>
 
-#if defined(__GLIBC__) && __GLIBC__ == 2
+#if defined(__ANDROID__) || (defined(__GLIBC__) && __GLIBC__ == 2)
 #include <netinet/ip.h>
 #include <netinet/in.h>
 #include <netinet/ip_icmp.h>