Closed Bug 193380 Opened 18 years ago Closed 18 years ago

directoryserver need ipv6 support on HPUX 11i


(NSPR :: NSPR, enhancement, P1)



(Not tracked)



(Reporter: sonja.mirtitsch, Assigned: wtc)



(5 files, 2 obsolete files)

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_INET6_PROBE

/* 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;

Severity: normal → enhancement
Priority: -- → P1
I cleaned up the patch and did a release build in
so the directoryserver team can test this
Attached patch patchSplinter Review
I'm going to ask a few questions to help me decide
what's the best way to add IPv6 support to NSPR for

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.

> 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.

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.
Target Milestone: --- → 4.3
Attached 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.
I am building with the previous version of the patch at the moment, and will
test the new one tomorrow.
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

   if ${OS_RELEASE} >= B.11.11 then

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

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
	case $OS in
			echo "$OS greater or equal";;
			echo "$OS less";;


Attached 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/

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.
Attached patch Proposed patch for NSPR TIP, v2 (obsolete) — Splinter Review
We also need "B.[2-9]*" in the case pattern.
Attachment #115022 - Attachment is obsolete: true
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
Fix checked into the NSPR TIP (NSPR 4.3) and the
NSPRPUB_PRE_4_2_CLIENT_BRANCH (mozilla 1.4alpha).
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.