From 87e4ab84bb612135756ea03deab6976abf7c19b9 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Thu, 10 Jan 2013 17:20:23 -0500 Subject: [PATCH] Bug 828154: reapply local patches to netwerk/sctp/src rs=mcmanus --- netwerk/sctp/src/netinet/sctp_bsd_addr.c | 5 +++++ netwerk/sctp/src/netinet/sctp_os_userspace.h | 4 +++- netwerk/sctp/src/netinet/sctp_pcb.c | 5 +++++ netwerk/sctp/src/user_environment.c | 2 ++ netwerk/sctp/src/user_inpcb.h | 7 +++++++ netwerk/sctp/src/user_recv_thread.c | 4 ++++ netwerk/sctp/src/user_socketvar.h | 5 +++++ netwerk/sctp/src/usrsctp.h | 2 +- 8 files changed, 32 insertions(+), 2 deletions(-) diff --git a/netwerk/sctp/src/netinet/sctp_bsd_addr.c b/netwerk/sctp/src/netinet/sctp_bsd_addr.c index 23fea12d4d9b..8b766d3fb1c8 100755 --- a/netwerk/sctp/src/netinet/sctp_bsd_addr.c +++ b/netwerk/sctp/src/netinet/sctp_bsd_addr.c @@ -49,8 +49,13 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.c 239035 2012-08-04 08:03:30Z #include #include #if !defined(__Userspace_os_Windows) +#if defined(ANDROID) +#include +#include +#else #include #endif +#endif /* Declare all of our malloc named types */ #ifndef __Panda__ diff --git a/netwerk/sctp/src/netinet/sctp_os_userspace.h b/netwerk/sctp/src/netinet/sctp_os_userspace.h index d8c1f84a5058..565de8a2ef30 100755 --- a/netwerk/sctp/src/netinet/sctp_os_userspace.h +++ b/netwerk/sctp/src/netinet/sctp_os_userspace.h @@ -381,7 +381,7 @@ struct udphdr { #else /* !defined(Userspace_os_Windows) */ #include /* needed? added from old __FreeBSD__ */ #include -#if defined(__Userspace_os_FreeBSD) +#if defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_Linux) || defined(__Userspace_os_Android) #include #endif typedef pthread_mutex_t userland_mutex_t; @@ -461,7 +461,9 @@ struct sx {int dummy;}; /* for getifaddrs */ #include #if !defined(__Userspace_os_Windows) +#if !defined(ANDROID) #include +#endif /* for ioctl */ #include diff --git a/netwerk/sctp/src/netinet/sctp_pcb.c b/netwerk/sctp/src/netinet/sctp_pcb.c index ea3418107dcb..0b68306f9f6c 100755 --- a/netwerk/sctp/src/netinet/sctp_pcb.c +++ b/netwerk/sctp/src/netinet/sctp_pcb.c @@ -69,8 +69,13 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 244729 2012-12-27 08:06:58Z tuex #endif #if defined(__Userspace__) #if !defined(__Userspace_os_Windows) +#if defined(ANDROID) +#include +#include +#else #include #endif +#endif #include #endif diff --git a/netwerk/sctp/src/user_environment.c b/netwerk/sctp/src/user_environment.c index f3d851a88105..c32d889953c1 100755 --- a/netwerk/sctp/src/user_environment.c +++ b/netwerk/sctp/src/user_environment.c @@ -34,8 +34,10 @@ #if !defined (__Userspace_os_Windows) #include #if !defined(__Userspace_os_FreeBSD) +#if !defined(ANDROID) #include #endif +#endif #include #endif #include diff --git a/netwerk/sctp/src/user_inpcb.h b/netwerk/sctp/src/user_inpcb.h index f842210cf6ab..7bf47f1b51b6 100755 --- a/netwerk/sctp/src/user_inpcb.h +++ b/netwerk/sctp/src/user_inpcb.h @@ -35,6 +35,13 @@ #include /* was */ +#if defined(ANDROID) +#include +#include +/* missing defines in Android bionic libc/NDK */ +typedef uint16_t in_port_t; +#endif + #define in6pcb inpcb /* for KAME src sync over BSD*'s */ #define in6p_sp inp_sp /* for KAME src sync over BSD*'s */ struct inpcbpolicy; diff --git a/netwerk/sctp/src/user_recv_thread.c b/netwerk/sctp/src/user_recv_thread.c index 45180e5b135f..e420a648567f 100755 --- a/netwerk/sctp/src/user_recv_thread.c +++ b/netwerk/sctp/src/user_recv_thread.c @@ -442,6 +442,7 @@ recv_function_raw(void *arg) #else pthread_exit(NULL); #endif + return NULL; } #endif @@ -625,6 +626,7 @@ recv_function_raw6(void *arg) #else pthread_exit(NULL); #endif + return NULL; } #endif @@ -829,6 +831,7 @@ recv_function_udp(void *arg) #else pthread_exit(NULL); #endif + return NULL; } #endif @@ -1015,6 +1018,7 @@ recv_function_udp6(void *arg) #else pthread_exit(NULL); #endif + return NULL; } #endif diff --git a/netwerk/sctp/src/user_socketvar.h b/netwerk/sctp/src/user_socketvar.h index 1264317119f3..0ebdd219ae5d 100755 --- a/netwerk/sctp/src/user_socketvar.h +++ b/netwerk/sctp/src/user_socketvar.h @@ -37,6 +37,11 @@ #include #include #endif +#if defined(ANDROID) +/* Android bionic libc is missing some defines in sys/types.h. Pick them + * up elsewhere */ +#include +#endif /* #include */ /*__Userspace__ alternative?*/ /* for struct selinfo */ /* #include was 0 byte file */ diff --git a/netwerk/sctp/src/usrsctp.h b/netwerk/sctp/src/usrsctp.h index 52386e45c199..428033450f5d 100644 --- a/netwerk/sctp/src/usrsctp.h +++ b/netwerk/sctp/src/usrsctp.h @@ -968,7 +968,7 @@ usrsctp_register_address(void *); void usrsctp_deregister_address(void *); -#define SCTP_DUMP_OUTBOUND 1 +#define SCTP_DUMP_OUTBOUND 0 #define SCTP_DUMP_INBOUND 0 char *