Bugzilla bug #77264: the workaround for the new struct sockaddr_in6 in
authorwtc%netscape.com
Fri, 08 Jun 2001 19:54:56 +0000
changeset 1934 e2b97fb2b8c059dec0c4293f8e34328d78228a96
parent 1928 4b0df8447b4b8e40abbedd29e95320dea8f326b5
child 1935 a245729a5b7879d81d0b1ae6f644fb72ccb90714
push idunknown
push userunknown
push dateunknown
bugs77264
Bugzilla bug #77264: the workaround for the new struct sockaddr_in6 in glibc 2.2 is only needed when we compile with glibc 2.1. Modified files: prsocket.c, ptio.c
pr/src/io/prsocket.c
pr/src/pthreads/ptio.c
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -60,17 +60,17 @@ static PRBool IsValidNetAddrLen(const PR
      * The definition of the length of a Unix domain socket address
      * is not uniform, so we don't check it.
      */
     if ((addr != NULL)
 #ifdef XP_UNIX
             && (addr->raw.family != AF_UNIX)
 #endif
             && (PR_NETADDR_SIZE(addr) != addr_len)) {
-#if defined(LINUX)
+#if defined(LINUX) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 1
         /*
          * 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)
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -231,17 +231,17 @@ static PRBool IsValidNetAddrLen(const PR
 {
     /*
      * The definition of the length of a Unix domain socket address
      * is not uniform, so we don't check it.
      */
     if ((addr != NULL)
             && (addr->raw.family != AF_UNIX)
             && (PR_NETADDR_SIZE(addr) != addr_len)) {
-#if defined(LINUX)
+#if defined(LINUX) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 1
         /*
          * 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)