Patchwork [iptables,1/3] android: libiptc: Fix socklen_t type mismatch on Android

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

Comments

Kevin Cernekee - Oct. 26, 2013, 6:50 p.m.
Bionic defines socklen_t as a signed int, so redefining it as unsigned
breaks the build.

This change comes from AOSP.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 libiptc/libip4tc.c |    2 +-
 libiptc/libip6tc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Jan Engelhardt - Oct. 28, 2013, 12:31 p.m.
On Saturday 2013-10-26 20:50, Kevin Cernekee wrote:
> 
>-#if !defined(__GLIBC__) || (__GLIBC__ < 2)
>+#if !defined(__ANDROID__) && (!defined(__GLIBC__) || (__GLIBC__ < 2))
> typedef unsigned int socklen_t;
> #endif

Do we still need this group of 3 lines anyway? Are we willingly
targeting any libc which does not have socklen_t defined --
or glibc 1.x for that matter?
--
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/libiptc/libip4tc.c b/libiptc/libip4tc.c
index dd59951..2b029d4 100644
--- a/libiptc/libip4tc.c
+++ b/libiptc/libip4tc.c
@@ -22,7 +22,7 @@ 
 #define inline
 #endif
 
-#if !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if !defined(__ANDROID__) && (!defined(__GLIBC__) || (__GLIBC__ < 2))
 typedef unsigned int socklen_t;
 #endif
 
diff --git a/libiptc/libip6tc.c b/libiptc/libip6tc.c
index ca01bcb..4e47e69 100644
--- a/libiptc/libip6tc.c
+++ b/libiptc/libip6tc.c
@@ -23,7 +23,7 @@ 
 #define inline
 #endif
 
-#if !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if !defined(__ANDROID__) && (!defined(__GLIBC__) || (__GLIBC__ < 2))
 typedef unsigned int socklen_t;
 #endif