summaryrefslogtreecommitdiff
path: root/pr/src/pthreads/ptio.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/src/pthreads/ptio.c')
-rw-r--r--pr/src/pthreads/ptio.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c
index b301ebd5..d9a2bd47 100644
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -123,7 +123,7 @@ static ssize_t (*pt_aix_sendfile_fptr)() = NULL;
#define _PRSockOptVal_t char *
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \
|| defined(LINUX) || defined(FREEBSD) || defined(BSDI) || defined(VMS) \
- || defined(NTO) || defined(OPENBSD)
+ || defined(NTO) || defined(OPENBSD) || defined(RHAPSODY)
#define _PRSockOptVal_t void *
#else
#error "Cannot determine architecture"
@@ -137,7 +137,7 @@ static ssize_t (*pt_aix_sendfile_fptr)() = NULL;
|| defined(OSF1) || defined(SOLARIS) \
|| defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
- || defined(BSDI) || defined(VMS) || defined(NTO)
+ || defined(BSDI) || defined(VMS) || defined(NTO) || defined(RHAPSODY)
#define _PRSelectFdSetArg_t fd_set *
#else
#error "Cannot determine architecture"
@@ -174,6 +174,19 @@ static PRBool IsValidNetAddrLen(const PRNetAddr *addr, PRInt32 addr_len)
if ((addr != NULL)
&& (addr->raw.family != AF_UNIX)
&& (PR_NETADDR_SIZE(addr) != addr_len)) {
+#if defined(LINUX)
+ /*
+ * In glibc 2.1, struct sockaddr_in6 is 24 bytes. In glibc 2.2
+ * and in the 2.4 kernel, struct sockaddr_in6 has the scope_id
+ * field and is 28 bytes. It is possible for socket functions
+ * to return an addr_len greater than sizeof(struct sockaddr_in6).
+ * We need to allow that. (Bugzilla bug #77264)
+ */
+ if ((PR_AF_INET6 == addr->raw.family)
+ && (sizeof(addr->ipv6) == addr_len)) {
+ return PR_TRUE;
+ }
+#endif
return PR_FALSE;
}
return PR_TRUE;
@@ -2424,7 +2437,8 @@ static PRIOMethods _pr_socketpollfd_methods = {
#if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
|| defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) \
- || defined(OPENBSD) || defined(BSDI) || defined(VMS) || defined(NTO)
+ || defined(OPENBSD) || defined(BSDI) || defined(VMS) || defined(NTO) \
+ || defined(RHAPSODY)
#define _PR_FCNTL_FLAGS O_NONBLOCK
#else
#error "Can't determine architecture"