зеркало из https://github.com/mozilla/pjs.git
Bugzilla bug 222037: we need to adjust the address family field of
PRNetAddr on return from getpeername. The patch is contributed by Fredrik Holmqvist <thesuckiestemail@yahoo.se>. r=wtc,darin.
This commit is contained in:
Родитель
ff24f13dc1
Коммит
7a1803e003
|
@ -744,6 +744,15 @@ _MD_getpeername (PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen)
|
|||
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче