directoryserver need ipv6 support on HPUX 11i

RESOLVED FIXED in 4.3

Status

enhancement
P1
normal
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: sonja.mirtitsch, Assigned: wtc)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments, 2 obsolete attachments)

Reporter

Description

17 years ago
we got a patch from the directory server team to add support for IPv6 on
HPUX11i.This is high priority for us.
The patch has been tested on 32bit only. Directory server is able to start on a
iPv6 interface and is reachable by clients, I am, at the moment building 32 and
64 bit versions that we will  give the directoryserver team to test, and once I
am done I'll attach the real patch here (full cvs diff -u with the makefile changes)


file mozilla/nsprpub/pr/include/md/_hpux.h (or equivalent)
 

#define HPUX11i        /* TEMP: don't know where it is supposed to be defined */

#ifdef HPUX11i

#define _PR_HAVE_GETIPNODEBYNAME
#define _PR_HAVE_GETIPNODEBYADDR
#define _PR_INET6_PROBE
#define _PR_HAVE_MD_SOCKADDR_IN6

/* isomorphic to struct in6_addr */
struct _md_in6_addr {
    union {
        PRUint8  _S6_u8[16];
        PRUint32 _S6_u32[4];
        PRUint32 __S6_align;
    } _S6_un;
};

/* isomorphic to struct sockaddr_in6 */
struct _md_sockaddr_in6 {
    PRUint16 sin6_family;
    PRUint16 sin6_port;
    PRUint32 sin6_flowinfo;
    struct _md_in6_addr sin6_addr;
    PRUint32 sin6_scope_id;
};

#endif
Reporter

Updated

17 years ago
Severity: normal → enhancement
Priority: -- → P1
Reporter

Comment 1

17 years ago
I cleaned up the patch and did a release build in
/share/builds/mccrel/nspr/nspr414/builds/20030214.2/hploan1_HPUX11i
so the directoryserver team can test this
Reporter

Comment 2

17 years ago
Posted patch patchSplinter Review
Assignee

Comment 3

17 years ago
I'm going to ask a few questions to help me decide
what's the best way to add IPv6 support to NSPR for
HP-UX.

1. Do you want to run your HP-UX 11.00 binaries on
HP-UX 11i and they need to automatically detect the
presence of IPv6 stack?  Or do you also have HP-UX
11i binaries and only run the HP-UX 11i binaries on
HP-UX 11i machines?

2. On HP-UX 11i, compile and run this test:

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <errno.h>

int main()
{
    int sock;

    sock = socket(AF_INET6, SOCK_STREAM, 0);
    if (sock == -1) {
        printf("socket(AF_INET6) failed: %d\n", errno);
    }
    printf("size of struct sockaddr_in6 is %d\n",
            (int)sizeof(struct sockaddr_in6));
    return 0;
}

First compile it with +DAportable +DS2.0 (32-bit PA-RISC).
Then compile it with +DA2.0W +DS2.0 (64-bit PA-RISC).
Let me know what the output is when you run it.  Also let
me know if the HP-UX 11i machine has an IPv6 interface.

Thanks.
Status: NEW → ASSIGNED
Reporter

Comment 5

17 years ago
> 1. Do you want to run your HP-UX 11.00 binaries on
> HP-UX 11i and they need to automatically detect the
> presence of IPv6 stack?  Or do you also have HP-UX
> 11i binaries and only run the HP-UX 11i binaries on
> HP-UX 11i machines?

we forwarded the question to the directoryserver team, and I will post their
reply on the bug.


Assignee

Comment 6

17 years ago
Thanks for the test program output.

The size of the 'ipv6' member of the PRNetAddr union
is 32 for both 32-bit and 64-bit HP-UX PA-RISC.

This patch is for the NSPR 4.1 branch.	It assumes that
only the build you do on HP-UX 11i or higher needs to
support IPv6.
Assignee

Updated

17 years ago
Target Milestone: --- → 4.3
Assignee

Comment 7

17 years ago
Posted patch Simpler patchSplinter Review
We can use this patch if there are no HP-UX releases
between B.11.00 and B.11.11.  This patch also works
for the TIP of NSPR.
Reporter

Comment 8

17 years ago
I am building with the previous version of the patch at the moment, and will
test the new one tomorrow.
Reporter

Comment 9

17 years ago
The directory server team tested with the first patch in attachment id=114843
and found it solves their problem. 

Also, they are only only interested in supporting 11i, with the 11i binaries so
we don't need to worry about the need to automatically detect the presence of
IPv6 stack. (We build NSPR for 11.0 too, and if they wanted to support 11.0
they'd need to pich up that version. I am not sure why the -Dportable flag is a
requirenment) 

===
   if ${OS_RELEASE} >= B.11.11 then
        USE_IPV6=1
    fi

On previous occasions for similar problems I'd mainly use inline perl or case
constructs and regex; I realize it is not very elegant, but it works

case $OS_RELEASE in
	[C-Z]*|B.1[2-9]*|B.11.[2-9]*|B.11.1[1-9]*)
		USE_IPV6=1;;
esac

to test the construct you can use the following script:
#! /bin/sh

for OS in B.11.11 A.11.11 C.11.11 Z.11.11 B.11.10 B.10.11 \
          B.12.11 B.11.12 B.11.22 B.11.11.16
do
	case $OS in
		[C-Z]*|B.1[2-9]*|B.11.[2-9]*|B.11.1[1-9]*)
			echo "$OS greater or equal";;
                *)
			echo "$OS less";;
	esac

done



 
Assignee

Comment 10

17 years ago
Posted patch Proposed patch for NSPR TIP (obsolete) — Splinter Review
To test this patch, you need to regenerate mozilla/nsprpub/configure:
% cd mozilla/nsprpub
% autoconf

I also improved the detection of B.11.* in mozilla/nsprpub/configure.in.

Thank you for the "case" pattern matching trick, Sonja.  I used it in
this patch.  It should be faster than using echo, sort, and sed.
Assignee

Comment 11

17 years ago
We also need "B.[2-9]*" in the case pattern.
Attachment #115022 - Attachment is obsolete: true
Assignee

Comment 12

17 years ago
It turns out that [ and ] are quote characters for M4,
which autoconf depends on.  Since our case patterns use
[], we need to either quote them or temporarily change
the M4 quote characters to something else.  This patch
does the latter, with the M4 changequote macro.
Attachment #115023 - Attachment is obsolete: true
Assignee

Comment 13

17 years ago
Fix checked into the NSPR TIP (NSPR 4.3) and the
NSPRPUB_PRE_4_2_CLIENT_BRANCH (mozilla 1.4alpha).
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.