Closed Bug 20770 Opened 25 years ago Closed 25 years ago

Port to Solaris 8 IPv6

Categories

(NSPR :: NSPR, defect, P3)

Sun
Solaris
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

Solaris 8 has IPv6 integrated into the operating system.
This bug report is to track the porting of NSPR to Solaris
8 IPv6.
Status: NEW → ASSIGNED
Define _PR_HAVE_GETIPNODEBYNAME in _solaris.h because
Solaris 8 has getipnodebyname().
/cvsroot/mozilla/nsprpub/pr/include/md/_solaris.h, revision 3.9
/m/src/ns/nspr20/pr/include/md/_solaris.h, revision 2.17

With this checkin, NSPR can be built on Solaris 8 with IPv6
support (need to specify USE_IPV6=1 to gmake).
I found that if you pass AF_INET as the 'af' (address
family) argument to getipnodebyname(), the function
returns a hostent structure whose h_aliases is null,
whether the host has aliases or not.  This breaks our
CopyHostent function in mozilla/nsprpub/pr/src/misc/prnetdb.c
because CopyHostent assumes h_aliases cannot be null.

I am not sure if returning a null h_aliases is a bug,
but it's certainly new behavior.  The old behavior (of
gethostbyname) is to return a non-null h_aliases whose
first element h_aliases[0] is null, if the host has no
aliases.

Also note that if you pass AF_INET6 as the 'af' argument
and AI_DEFAULT as the 'flags' argument, getipnodebyname()
returns a non-null h_aliases.

I will attach a test program ipnode.c with test runs on
a host with no aliases ("abel") and a host with aliases
("www.netscape.com").
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fixed the CopyHostent function to deal with the possibility
that h_aliases can be null.  In that case, we allocate in
our copy a one-element array whose only element is a null
pointer.
/cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c, revision 3.11
(/m/src/ns/nspr20/pr/src/misc/prnetdb.c, revision 2.14)

Fixed the build problem that the gethost.c test needs
to link with -lsocket when USE_IPV6=1 is specified.
/cvsroot/mozilla/nsprpub/pr/tests/Makefile, revision 3.46
(/m/src/ns/nspr20/pr/tests/Makefile, revision 2.77)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: