summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2001-05-22 14:15:40 +0000
committerwtc%netscape.com <devnull@localhost>2001-05-22 14:15:40 +0000
commit0662ddef5046d868a60787b179ed5eaa63523320 (patch)
tree75c68ba585016e9d5e048494c921d37065975b79
parent76e38bb78097685d3f4bdb661546a97396f3d0c9 (diff)
downloadnspr-hg-0662ddef5046d868a60787b179ed5eaa63523320.tar.gz
Bugzilla bug #51135: IPv6 support on OpenVMS. Thanks to Colin Blakes
<colin@theblakes.com> for the patch. Modified files: configure configure.in OpenVMS.mk _openvms.h pripv6.c NSPRPUB_CLIENT_BRANCH
-rw-r--r--config/OpenVMS.mk4
-rwxr-xr-xconfigure54
-rw-r--r--configure.in1
-rw-r--r--pr/include/md/_openvms.h19
-rw-r--r--pr/src/io/pripv6.c17
5 files changed, 55 insertions, 40 deletions
diff --git a/config/OpenVMS.mk b/config/OpenVMS.mk
index 0a7a51d6..d71daf90 100644
--- a/config/OpenVMS.mk
+++ b/config/OpenVMS.mk
@@ -35,9 +35,9 @@ RANLIB = /bin/true
CPU_ARCH_TAG = _$(CPU_ARCH)
OS_CFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
- -DGENERIC_PTHREAD_REDEFINES
+ -DGENERIC_PTHREAD_REDEFINES -D_SOCKADDR_LEN
OS_CXXFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
- -DGENERIC_PTHREAD_REDEFINES
+ -DGENERIC_PTHREAD_REDEFINES -D_SOCKADDR_LEN
#
# XCFLAGS are the only CFLAGS that are used during a link operation. Defining
diff --git a/configure b/configure
index 356a9129..eb586fbb 100755
--- a/configure
+++ b/configure
@@ -3737,6 +3737,10 @@ EOF
EOF
cat >> confdefs.h <<\EOF
+#define _SOCKADDR_LEN 1
+EOF
+
+ cat >> confdefs.h <<\EOF
#define GENERIC_PTHREAD_REDEFINES 1
EOF
@@ -4254,12 +4258,12 @@ fi
if test -z "$SKIP_LIBRARY_CHECKS"; then
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4258: checking for dlopen" >&5
+echo "configure:4262: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4263 "configure"
+#line 4267 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -4282,7 +4286,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:4286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -4301,7 +4305,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4305: checking for dlopen in -ldl" >&5
+echo "configure:4309: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4309,7 +4313,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4313 "configure"
+#line 4317 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4320,7 +4324,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:4324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4347,7 +4351,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:4351: checking how to run the C preprocessor" >&5
+echo "configure:4355: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -4362,13 +4366,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 4366 "configure"
+#line 4370 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -4379,13 +4383,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 4383 "configure"
+#line 4387 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -4396,13 +4400,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 4400 "configure"
+#line 4404 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -4428,13 +4432,13 @@ echo "$ac_t""$CPP" 1>&6
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:4432: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:4436: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 4438 "configure"
+#line 4442 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -4452,7 +4456,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 4456 "configure"
+#line 4460 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -4476,12 +4480,12 @@ fi
for ac_func in lchown strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4480: checking for $ac_func" >&5
+echo "configure:4484: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4485 "configure"
+#line 4489 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4504,7 +4508,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4535,7 +4539,7 @@ done
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:4539: checking for pthread_create in -lpthreads" >&5
+echo "configure:4543: checking for pthread_create in -lpthreads" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4557,7 +4561,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:4561: checking for pthread_create in -lpthread" >&5
+echo "configure:4565: checking for pthread_create in -lpthread" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4579,7 +4583,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:4583: checking for pthread_create in -lc_r" >&5
+echo "configure:4587: checking for pthread_create in -lc_r" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4601,7 +4605,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:4605: checking for pthread_create in -lc" >&5
+echo "configure:4609: checking for pthread_create in -lc" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@@ -4751,7 +4755,7 @@ if test -n "$USE_PTHREADS"; then
rm -f conftest*
ac_cv_have_dash_pthread=no
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:4755: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:4759: checking whether ${CC-cc} accepts -pthread" >&5
echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then
@@ -4767,7 +4771,7 @@ echo "configure:4755: checking whether ${CC-cc} accepts -pthread" >&5
ac_cv_have_dash_pthreads=no
if test "$ac_cv_have_dash_pthread" = "no"; then
echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
-echo "configure:4771: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:4775: checking whether ${CC-cc} accepts -pthreads" >&5
echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then
diff --git a/configure.in b/configure.in
index 96d29238..3d3b8229 100644
--- a/configure.in
+++ b/configure.in
@@ -1217,6 +1217,7 @@ mips-sony-newsos*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(VMS)
AC_DEFINE(VMS_AS_IS)
+ AC_DEFINE(_SOCKADDR_LEN)
AC_DEFINE(GENERIC_PTHREAD_REDEFINES)
RESOLVE_LINK_SYMBOLS=1
CROSS_COMPILE=1
diff --git a/pr/include/md/_openvms.h b/pr/include/md/_openvms.h
index 97f55aa6..e79d4a79 100644
--- a/pr/include/md/_openvms.h
+++ b/pr/include/md/_openvms.h
@@ -83,6 +83,7 @@ struct ip_mreq {
#define _PR_NO_LARGE_FILES
/* IPv6 support */
+#define _PR_HAVE_SOCKADDR_LEN
#define _PR_HAVE_GETIPNODEBYNAME
#define _PR_HAVE_GETIPNODEBYADDR
#define _PR_INET6_PROBE
@@ -93,6 +94,24 @@ struct ip_mreq {
#define AI_ADDRCONFIG 0x00000020
#endif
+#define _PR_HAVE_MD_SOCKADDR_IN6
+/* if we have a quadword field defined in the structure, then its length */
+/* will be a multiple of 8, and connect() won't accept 32 (it wants 28) */
+struct _md_in6_addr {
+ union {
+ PRUint8 _S6_u8[16];
+ PRUint16 _S6_u16[8];
+ PRUint32 _S6_u32[4];
+ } _S6_un;
+};
+struct _md_sockaddr_in6 {
+ PRUint16 sin6_family;
+ PRUint16 sin6_port;
+ PRUint32 sin6_flowinfo;
+ struct _md_in6_addr sin6_addr;
+ PRUint32 sin6_scope_id;
+};
+
#undef USE_SETJMP
#include <setjmp.h>
diff --git a/pr/src/io/pripv6.c b/pr/src/io/pripv6.c
index f5635a59..4a811528 100644
--- a/pr/src/io/pripv6.c
+++ b/pr/src/io/pripv6.c
@@ -277,24 +277,15 @@ PRStatus _pr_init_ipv6()
#if !defined(_PR_INET6) && defined(_PR_HAVE_GETIPNODEBYNAME)
PRLibrary *lib;
#if defined(VMS)
-#define GETIPNODEBYNAME "DECC$GETIPNODEBYNAME"
-#define GETIPNODEBYADDR "DECC$GETIPNODEBYADDR"
-#define FREEHOSTENT "DECC$FREEHOSTENT"
-#define GAISTRERROR "DECC$GAISTRERROR"
- typedef char * (*_pr_getstrerror_t)(int);
- _pr_getstrerror_t _pr_gaistrerror_fp;
- _pr_getipnodebyname_fp = NULL;
- _pr_gaistrerror_fp = (_pr_getstrerror_t)PR_FindSymbolAndLibrary(GAISTRERROR, &lib);
- if (NULL != _pr_gaistrerror_fp) {
- if (NULL != (*_pr_gaistrerror_fp)(0))
- _pr_getipnodebyname_fp = PR_FindSymbol(lib, GETIPNODEBYNAME);
- }
+#define GETIPNODEBYNAME getenv("GETIPNODEBYNAME")
+#define GETIPNODEBYADDR getenv("GETIPNODEBYADDR")
+#define FREEHOSTENT getenv("FREEHOSTENT")
#else
#define GETIPNODEBYNAME "getipnodebyname"
#define GETIPNODEBYADDR "getipnodebyaddr"
#define FREEHOSTENT "freehostent"
- _pr_getipnodebyname_fp = PR_FindSymbolAndLibrary(GETIPNODEBYNAME, &lib);
#endif
+ _pr_getipnodebyname_fp = PR_FindSymbolAndLibrary(GETIPNODEBYNAME, &lib);
if (NULL != _pr_getipnodebyname_fp) {
_pr_freehostent_fp = PR_FindSymbol(lib, FREEHOSTENT);
if (NULL != _pr_freehostent_fp) {