Last Comment Bug 211512 - PR_Connect() fails on panther beta
: PR_Connect() fails on panther beta
Status: RESOLVED FIXED
:
Product: NSPR
Classification: Components
Component: NSPR (show other bugs)
: other
: PowerPC Mac OS X
: -- normal (vote)
: 4.4.1
Assigned To: Wan-Teh Chang
: Wan-Teh Chang
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-07-02 17:57 PDT by Brian Ryner (not reading)
Modified: 2003-07-15 11:30 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch from wtc (984 bytes, patch)
2003-07-02 17:59 PDT, Brian Ryner (not reading)
bryner: review+
Details | Diff | Splinter Review
patch from wtc, v2 (1.78 KB, patch)
2003-07-08 15:41 PDT, Wan-Teh Chang
bryner: review+
Details | Diff | Splinter Review
Patch that was checked in (2.77 KB, patch)
2003-07-08 20:50 PDT, Wan-Teh Chang
no flags Details | Diff | Splinter Review
patch by df for 10.1 (1.57 KB, patch)
2003-07-14 10:21 PDT, Dylan Foley
no flags Details | Diff | Splinter Review
Patch to define IPV6_V6ONLY on 10.1 (683 bytes, patch)
2003-07-14 11:53 PDT, Wan-Teh Chang
no flags Details | Diff | Splinter Review
Second patch that was checked in (2.52 KB, patch)
2003-07-15 11:28 PDT, Wan-Teh Chang
no flags Details | Diff | Splinter Review

Description Brian Ryner (not reading) 2003-07-02 17:57:54 PDT
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.
Comment 1 Brian Ryner (not reading) 2003-07-02 17:59:15 PDT
Created attachment 126972 [details] [diff] [review]
patch from wtc

This is a patch wtc sent to me.
Comment 2 Brian Ryner (not reading) 2003-07-02 18:01:13 PDT
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?
Comment 3 Simon Fraser 2003-07-03 09:45:31 PDT
Have we filed a bug with Apple on that option being on by default?
Comment 4 Brian Ryner (not reading) 2003-07-03 11:17:11 PDT
Radar bug 3314011.
Comment 5 Wan-Teh Chang 2003-07-08 15:41:40 PDT
Created attachment 127274 [details] [diff] [review]
patch from wtc, v2

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.
Comment 6 Wan-Teh Chang 2003-07-08 15:44:15 PDT
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?
Comment 7 Brian Ryner (not reading) 2003-07-08 16:50:03 PDT
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?
Comment 8 Brian Ryner (not reading) 2003-07-08 17:15:19 PDT
Never mind my last comment, I saw the socket() nearby and figured this was
during socket creation.
Comment 9 Brian Ryner (not reading) 2003-07-08 17:27:49 PDT
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).
Comment 10 Wan-Teh Chang 2003-07-08 20:50:47 PDT
Created attachment 127321 [details] [diff] [review]
Patch that was checked in

This is the same as patch v2 except that I fixed the
indentation problem and defined what "Panther" is in
the comment.
Comment 11 Wan-Teh Chang 2003-07-08 20:52:31 PDT
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).
Comment 12 Dylan Foley 2003-07-12 18:41:06 PDT
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'
...
Comment 13 Dylan Foley 2003-07-14 10:21:09 PDT
Created attachment 127740 [details] [diff] [review]
patch by df for 10.1

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.
Comment 14 Wan-Teh Chang 2003-07-14 11:53:08 PDT
Created attachment 127742 [details] [diff] [review]
Patch to define IPV6_V6ONLY on 10.1

Could you test this patch on Mac OS X 10.1?  Thanks.
Comment 15 Dylan Foley 2003-07-14 13:02:17 PDT
This patch works for me on 10.1. Thanks!
Comment 16 Wan-Teh Chang 2003-07-15 11:28:13 PDT
Created attachment 127824 [details] [diff] [review]
Second patch that was checked in

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.
Comment 17 Wan-Teh Chang 2003-07-15 11:30:51 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.