Closed Bug 211512 Opened 22 years ago Closed 22 years ago

PR_Connect() fails on panther beta

Categories

(NSPR :: NSPR, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bryner, Assigned: wtc)

Details

Attachments

(4 files, 2 obsolete files)

As wtc and I discussed, PR_Connect() fails on the Panther beta because the OS connect() returns EINVAL. The problem appears to be that the IPV6_V6ONLY socket option is enabled by default for AF_INET6 sockets.
Attached patch patch from wtc (obsolete) — Splinter Review
This is a patch wtc sent to me.
Comment on attachment 126972 [details] [diff] [review] patch from wtc r=bryner. One minor thing, I noticed that the prototype for setsockopt has the 4th argument as a void*, not char*. wtc, can you check this in on the trunk and client branch, if you think it's ok?
Attachment #126972 - Flags: review+
Have we filed a bug with Apple on that option being on by default?
Radar bug 3314011.
This patch performs a test during NSPR initialization to find out whether we need to turn off the IPV6_V6ONLY option. This way we can save the setsockopt calls on the Mac OS X releases that turn off the IPV6_V6ONLY option by default per RFC 3493. Please review and test this patch.
Attachment #126972 - Attachment is obsolete: true
Comment on attachment 127274 [details] [diff] [review] patch from wtc, v2 The only concern I have about this patch is that the use of IPV6_V6ONLY may break the build on Mac OS X 10.1. I don't know if that macro is defined on 10.1. Anyone knows?
Attachment #127274 - Flags: superreview?(sfraser)
Attachment #127274 - Flags: review?(bryner)
Comment on attachment 127274 [details] [diff] [review] patch from wtc, v2 Could we possibly test this just once, instead of every time we create a socket?
Never mind my last comment, I saw the socket() nearby and figured this was during socket creation.
Comment on attachment 127274 [details] [diff] [review] patch from wtc, v2 r=bryner. I tested this and it works fine. (The code indentation of the code in _pr_test_ipv6_socket looks a little off though).
Attachment #127274 - Flags: review?(bryner) → review+
This is the same as patch v2 except that I fixed the indentation problem and defined what "Panther" is in the comment.
Comment on attachment 127321 [details] [diff] [review] Patch that was checked in This patch has been checked into the NSPR tip (NSPR 4.4.1) and the NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.5a).
Status: NEW → ASSIGNED
Target Milestone: --- → 4.4.1
As suspected the patch causes the build to fail on OS X 10.1.5. From my build attempt: ... ptio.c: In function `pt_Connect': ptio.c:1530: warning: unused variable `addrp' ptio.c: In function `pt_Bind': ptio.c:1715: warning: unused variable `addrp' ptio.c: In function `pt_SendTo': ptio.c:1965: warning: unused variable `addrp' ptio.c: In function `_pr_test_ipv6_socket': ptio.c:3397: `IPV6_V6ONLY' undeclared (first use in this function) ptio.c:3397: (Each undeclared identifier is reported only once ptio.c:3397: for each function it appears in.) ptio.c: In function `PR_Socket': ptio.c:3459: `IPV6_V6ONLY' undeclared (first use in this function) ptio.c: In function `_pr_poll_with_poll': ptio.c:3723: warning: `start' might be used uninitialized in this function ptio.c: In function `PR_Select': ptio.c:4791: warning: `start' might be used uninitialized in this function make[7]: *** [ptio.o] Error 1 make[7]: Leaving directory `/usr/local/cvsrep/moz/mozilla/nsprpub/pr/src/pthreads' ...
Attached patch patch by df for 10.1 (obsolete) — Splinter Review
This patch gets past the problem on my machine. (I know nothing of C/C++ so it's probably horribly broken. Please forgive - thought it might still be helpful.) It seems to do the trick, just adds a few checks to see if defined(IPV6_V6ONLY). My build attempts still fails, though much later and in a completely unrelated area.
Could you test this patch on Mac OS X 10.1? Thanks.
Attachment #127740 - Attachment is obsolete: true
This patch works for me on 10.1. Thanks!
This is the second patch that was checked in. I also fixed the build problem for Mac OS X deployment target 10.2 or higher.
Both patches have been checked in. Mozilla 1.5a only has the first patch. So it won't build on Mac OS X 10.1 or for Mac OS X deployment target 10.2 or higher. Mozilla 1.5b will have both patches.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Attachment #127274 - Flags: superreview?(sfraser)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: