Merge to 1.6 branch FIREBIRD_0_8_BRANCH FIREFOX_0_8_RELEASE
authorben%bengoodger.com
Mon, 12 Jan 2004 23:31:09 +0000
branchFIREBIRD_0_8_BRANCH
changeset 3013 1a3d8122f7ba
parent 2997 b7630bfe005b
push idunknown
push userunknown
push dateunknown
Merge to 1.6 branch
pr/src/md/beos/bnet.c
--- a/pr/src/md/beos/bnet.c
+++ b/pr/src/md/beos/bnet.c
@@ -739,16 +739,25 @@ PRStatus
 PRStatus
 _MD_getpeername (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen)
 {
     PRInt32 rv, err;
 
     rv = getpeername(fd->secret->md.osfd,
                      (struct sockaddr *) addr, (_PRSockLen_t *)addrlen);
 
+#ifdef _PR_HAVE_SOCKADDR_LEN
+    if (rv == 0) {
+        /* ignore the sa_len field of struct sockaddr */
+        if (addr) {
+            addr->raw.family = ((struct sockaddr *) addr)->sa_family;
+        }
+    }
+#endif /* _PR_HAVE_SOCKADDR_LEN */
+
     if (rv < 0) {
         err = _MD_ERRNO();
         _PR_MD_MAP_GETPEERNAME_ERROR(err);
     }
     return rv==0?PR_SUCCESS:PR_FAILURE;
 }
 
 PRStatus