Bug 828154: reapply local patches to netwerk/sctp/src rs=mcmanus
authorRandell Jesup <rjesup@jesup.org>
Thu, 10 Jan 2013 17:20:23 -0500
changeset 118473 3253c4a1f2135f01b2951b2cc67aca22ad780add
parent 118472 715e21580ed2f61b1794fca9783eaa10029be2fa
child 118474 4f18799588dc7f9e0727ef09adade25e96461082
push id24166
push userMs2ger@gmail.com
push dateFri, 11 Jan 2013 13:57:41 +0000
treeherdermozilla-central@63c4b0f66a0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs828154
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 828154: reapply local patches to netwerk/sctp/src rs=mcmanus
netwerk/sctp/src/netinet/sctp_bsd_addr.c
netwerk/sctp/src/netinet/sctp_os_userspace.h
netwerk/sctp/src/netinet/sctp_pcb.c
netwerk/sctp/src/user_environment.c
netwerk/sctp/src/user_inpcb.h
netwerk/sctp/src/user_recv_thread.c
netwerk/sctp/src/user_socketvar.h
netwerk/sctp/src/usrsctp.h
--- a/netwerk/sctp/src/netinet/sctp_bsd_addr.c
+++ b/netwerk/sctp/src/netinet/sctp_bsd_addr.c
@@ -44,18 +44,23 @@
 #include <netinet/sctp_bsd_addr.h>
 #include <netinet/sctp_uio.h>
 #include <netinet/sctputil.h>
 #include <netinet/sctp_timer.h>
 #include <netinet/sctp_asconf.h>
 #include <netinet/sctp_sysctl.h>
 #include <netinet/sctp_indata.h>
 #if !defined(__Userspace_os_Windows)
+#if defined(ANDROID)
+#include <unistd.h>
+#include <ifaddrs-android-ext.h>
+#else
 #include <sys/unistd.h>
 #endif
+#endif
 
 /* Declare all of our malloc named types */
 #ifndef __Panda__
 MALLOC_DEFINE(SCTP_M_MAP, "sctp_map", "sctp asoc map descriptor");
 MALLOC_DEFINE(SCTP_M_STRMI, "sctp_stri", "sctp stream in array");
 MALLOC_DEFINE(SCTP_M_STRMO, "sctp_stro", "sctp stream out array");
 MALLOC_DEFINE(SCTP_M_ASC_ADDR, "sctp_aadr", "sctp asconf address");
 MALLOC_DEFINE(SCTP_M_ASC_IT, "sctp_a_it", "sctp asconf iterator");
--- a/netwerk/sctp/src/netinet/sctp_os_userspace.h
+++ b/netwerk/sctp/src/netinet/sctp_os_userspace.h
@@ -376,17 +376,17 @@ struct udphdr {
 	unsigned __int16 uh_dport;
 	unsigned __int16 uh_ulen;
 	unsigned __int16 uh_sum;
 };
 
 #else /* !defined(Userspace_os_Windows) */
 #include <sys/cdefs.h> /* needed? added from old __FreeBSD__ */
 #include <sys/socket.h>
-#if defined(__Userspace_os_FreeBSD)
+#if defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_Linux) || defined(__Userspace_os_Android)
 #include <pthread.h>
 #endif
 typedef pthread_mutex_t userland_mutex_t;
 typedef pthread_cond_t userland_cond_t;
 typedef pthread_t userland_thread_t;
 #endif
 
 #define mtx_lock(arg1)
@@ -456,17 +456,19 @@ struct sx {int dummy;};
 #include <user_ip_icmp.h>
 #endif
 /* #include <netinet/in_pcb.h> ported to userspace */
 #include <user_inpcb.h>
 
 /* for getifaddrs */
 #include <sys/types.h>
 #if !defined(__Userspace_os_Windows)
+#if !defined(ANDROID)
 #include <ifaddrs.h>
+#endif
 
 /* for ioctl */
 #include <sys/ioctl.h>
 
 /* for close, etc. */
 #include <unistd.h>
 #endif
 
--- a/netwerk/sctp/src/netinet/sctp_pcb.c
+++ b/netwerk/sctp/src/netinet/sctp_pcb.c
@@ -64,18 +64,23 @@
 #endif
 #if defined(__FreeBSD__)
 #include <sys/sched.h>
 #include <sys/smp.h>
 #include <sys/unistd.h>
 #endif
 #if defined(__Userspace__)
 #if !defined(__Userspace_os_Windows)
+#if defined(ANDROID)
+#include <unistd.h>
+#include <ifaddrs-android-ext.h>
+#else
 #include <sys/unistd.h>
 #endif
+#endif
 #include <user_socketvar.h>
 #endif
 
 #if defined(__APPLE__)
 #define APPLE_FILE_NO 4
 #endif
 
 #if defined(__FreeBSD__) && __FreeBSD_version >= 801000
--- a/netwerk/sctp/src/user_environment.c
+++ b/netwerk/sctp/src/user_environment.c
@@ -29,18 +29,20 @@
  */
 
 /* __Userspace__ */
 
 #include <stdlib.h>
 #if !defined (__Userspace_os_Windows)
 #include <stdint.h>
 #if !defined(__Userspace_os_FreeBSD)
+#if !defined(ANDROID)
 #include <sys/sysctl.h>
 #endif
+#endif
 #include <netinet/sctp_os_userspace.h>
 #endif
 #include <user_environment.h>
 #include <sys/types.h>
 /* #include <sys/param.h> defines MIN */
 #if !defined(MIN)
 #define MIN(arg1,arg2) ((arg1) < (arg2) ? (arg1) : (arg2))
 #endif
--- a/netwerk/sctp/src/user_inpcb.h
+++ b/netwerk/sctp/src/user_inpcb.h
@@ -30,16 +30,23 @@
  * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.100.2.1 2007/12/07 05:46:08 kmacy Exp $
  */
 
 #ifndef _USER_INPCB_H_
 #define _USER_INPCB_H_
 
 #include <user_route.h> /* was <net/route.h> */
 
+#if defined(ANDROID)
+#include <arpa/inet.h>
+#include <netinet/in.h>
+/* 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;
 
 /*
  * Struct inpcb is the ommon structure pcb for the Internet Protocol
  * implementation.
  *
--- a/netwerk/sctp/src/user_recv_thread.c
+++ b/netwerk/sctp/src/user_recv_thread.c
@@ -437,16 +437,17 @@ recv_function_raw(void *arg)
 	}
 	/* free the array itself */
 	free(recvmbuf);
 #if defined (__Userspace_os_Windows)
 	ExitThread(0);
 #else
 	pthread_exit(NULL);
 #endif
+	return NULL;
 }
 #endif
 
 #if defined(INET6)
 static void *
 recv_function_raw6(void *arg)
 {
 	struct mbuf **recvmbuf6;
@@ -620,16 +621,17 @@ recv_function_raw6(void *arg)
 	}
 	/* free the array itself */
 	free(recvmbuf6);
 #if defined (__Userspace_os_Windows)
 	ExitThread(0);
 #else
 	pthread_exit(NULL);
 #endif
+	return NULL;
 }
 #endif
 
 #ifdef INET
 static void *
 recv_function_udp(void *arg)
 {
 	struct mbuf **udprecvmbuf;
@@ -824,16 +826,17 @@ recv_function_udp(void *arg)
 	}
 	/* free the array itself */
 	free(udprecvmbuf);
 #if defined (__Userspace_os_Windows)
 	ExitThread(0);
 #else
 	pthread_exit(NULL);
 #endif
+	return NULL;
 }
 #endif
 
 #if defined(INET6)
 static void *
 recv_function_udp6(void *arg)
 {
 	struct mbuf **udprecvmbuf6;
@@ -1010,16 +1013,17 @@ recv_function_udp6(void *arg)
 	}
 	/* free the array itself */
 	free(udprecvmbuf6);
 #if defined (__Userspace_os_Windows)
 	ExitThread(0);
 #else
 	pthread_exit(NULL);
 #endif
+	return NULL;
 }
 #endif
 
 static void
 setReceiveBufferSize(int sfd, int new_size)
 {
 	int ch = new_size;
 
--- a/netwerk/sctp/src/user_socketvar.h
+++ b/netwerk/sctp/src/user_socketvar.h
@@ -32,16 +32,21 @@
 
 #ifndef _USER_SOCKETVAR_H_
 #define _USER_SOCKETVAR_H_
 
 #if defined(__Userspace_os_Darwin)
 #include <sys/types.h>
 #include <unistd.h>
 #endif
+#if defined(ANDROID)
+/* Android bionic libc is missing some defines in sys/types.h. Pick them
+ * up elsewhere */
+#include <linux/coda.h>
+#endif
 
 /* #include <sys/selinfo.h> */ /*__Userspace__ alternative?*/	/* for struct selinfo */
 /* #include <sys/_lock.h>  was 0 byte file */
 /* #include <sys/_mutex.h> was 0 byte file */
 /* #include <sys/_sx.h> */ /*__Userspace__ alternative?*/
 #if !defined(__Userspace_os_Windows) && !defined(__Userspace_os_FreeBSD)
 #include <sys/uio.h>
 #endif
--- a/netwerk/sctp/src/usrsctp.h
+++ b/netwerk/sctp/src/usrsctp.h
@@ -963,17 +963,17 @@ int
 usrsctp_get_non_blocking(struct socket *);
 
 void
 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 *
 usrsctp_dumppacket(void *, size_t, int);
 
 void
 usrsctp_freedumpbuffer(char *);