summaryrefslogtreecommitdiffstats
path: root/net/base/nss_memio.c
diff options
context:
space:
mode:
authorpvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 05:12:02 +0000
committerpvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 05:12:02 +0000
commitf32c173f2633b8e5ee74715f6a7a02e286d1de29 (patch)
tree0d415f5768215d98518d8d0f84f9d11dc05ddb67 /net/base/nss_memio.c
parent7a7769812fd4c6dde3242efcaab5d4276daf5b9c (diff)
downloadchromium_src-f32c173f2633b8e5ee74715f6a7a02e286d1de29.zip
chromium_src-f32c173f2633b8e5ee74715f6a7a02e286d1de29.tar.gz
chromium_src-f32c173f2633b8e5ee74715f6a7a02e286d1de29.tar.bz2
memio_SetPeerName implicitly assumes that struct sockaddr is the same as PRNetAddr, but this isn't true on *BSD
patch from sprewell@jaggeri.com Review URL: http://codereview.chromium.org/1589001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/nss_memio.c')
-rw-r--r--net/base/nss_memio.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/net/base/nss_memio.c b/net/base/nss_memio.c
index 6796882..5f7fd00 100644
--- a/net/base/nss_memio.c
+++ b/net/base/nss_memio.c
@@ -359,17 +359,11 @@ PRFileDesc *memio_CreateIOLayer(int bufsize)
return fd;
}
-void memio_SetPeerName(PRFileDesc *fd, const struct sockaddr *peername,
- size_t peername_len)
+void memio_SetPeerName(PRFileDesc *fd, const PRNetAddr *peername)
{
PRFileDesc *memiofd = PR_GetIdentitiesLayer(fd, memio_identity);
- struct PRFilePrivate *secret = memiofd->secret;
- size_t len;
-
- memset(&secret->peername, 0, sizeof(secret->peername));
- PR_ASSERT(peername_len <= sizeof(secret->peername));
- len = PR_MIN(peername_len, sizeof(secret->peername));
- memcpy(&secret->peername, peername, len);
+ struct PRFilePrivate *secret = memiofd->secret;
+ secret->peername = *peername;
}
memio_Private *memio_GetSecret(PRFileDesc *fd)