Closed
Bug 77264
Opened 24 years ago
Closed 24 years ago
assert in pt_GetPeerName on 2.4.3 IPv6 kernel
Categories
(NSPR :: NSPR, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
4.2
People
(Reporter: jgmyers, Assigned: wtc)
Details
Attachments
(3 files)
795 bytes,
patch
|
Details | Diff | Splinter Review | |
2.59 KB,
patch
|
Details | Diff | Splinter Review | |
1.33 KB,
patch
|
Details | Diff | Splinter Review |
On Linux with a 2.4.3 kernel with IPv6 enabled, I'm getting an assert in
pt_GetPeerName() with the IsValidNetAddrLen() check.
In /usr/include, sizeof(sockaddr_in6) is 24. In the kernel, it is 28 as a
32-bit scope_id field has been appended.
For linux at least we need to be able to accept both lengths. Any ideas how to
conditionalize this?
Reporter | ||
Comment 1•24 years ago
|
||
This happens when connecting to an IMAP/SSL server, as the SSL handshake code
calls the getpeername() method on the lower PRFileDesc.
Assignee | ||
Comment 2•24 years ago
|
||
John,
Are you saying that we pass addrlen (where *addrlen is 24) to
getpeername(), but on return *addrlen is 28? It would be wrong
for the kernel to do this.
Reporter | ||
Comment 3•24 years ago
|
||
No, we pass an addr_len of sizeof(PRNetAddr), which is significantly larger than
28. We then get upset that the kernel returned a value other than 24.
Reporter | ||
Comment 4•24 years ago
|
||
Comment 6•24 years ago
|
||
reassign to wtc
Need a little better fix than the proposed patch.
Assignee: larryh → wtc
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 4.2
Version: 3.0 → 4.0.2
Assignee | ||
Comment 8•24 years ago
|
||
Patch 35732 has been checked in on the trunk and
NSPRPUB_CLIENT_BRANCH of NSPR.
I'm going to attach another patch that conditionalizes
the workaround for glibc 2.1 only because glibc 2.2 or
newer doesn't need it.
Target Milestone: 4.2 → 4.1.2
Assignee | ||
Comment 9•24 years ago
|
||
Assignee | ||
Comment 10•24 years ago
|
||
I would appreciate it if you could give the new patch
(applied to NSPRPUB_CLIENT_BRANCH) a try.
Assignee | ||
Comment 11•24 years ago
|
||
I checked in the following patch on the trunk of NSPR. This workaround
is only needed for glibc 2.1 because glibc 2.0 does not have struct
sockaddr_in6 and glibc 2.2 has the RFC 2553 compliant struct sockaddr_in6.
Index: mozilla/nsprpub/pr/src/io/prsocket.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/io/prsocket.c,v
retrieving revision 3.46
diff -u -r3.46 prsocket.c
--- prsocket.c 2001/05/23 04:17:31 3.46
+++ prsocket.c 2001/06/08 19:38:46
@@ -65,7 +65,7 @@
&& (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
Index: mozilla/nsprpub/pr/src/pthreads/ptio.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/pthreads/ptio.c,v
retrieving revision 3.68
diff -u -r3.68 ptio.c
--- ptio.c 2001/05/23 04:17:33 3.68
+++ ptio.c 2001/06/08 19:38:47
@@ -236,7 +236,7 @@
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
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Target Milestone: 4.1.2 → 4.2
You need to log in
before you can comment on or make changes to this bug.
Description
•