$NetBSD: patch-am,v 1.10 2003/03/17 16:07:35 taya Exp $ diff -ru ../Orig/mozilla/nsprpub/pr/src/pthreads/ptio.c ./nsprpub/pr/src/pthreads/ptio.c --- ../Orig/mozilla/nsprpub/pr/src/pthreads/ptio.c 2003-01-21 05:50:00.000000000 +0900 +++ ./nsprpub/pr/src/pthreads/ptio.c 2003-03-14 16:58:52.000000000 +0900 @@ -194,7 +194,7 @@ #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \ || defined(LINUX) || defined(FREEBSD) || defined(BSDI) || defined(VMS) \ || defined(NTO) || defined(OPENBSD) || defined(DARWIN) \ - || defined(UNIXWARE) + || defined(UNIXWARE) || defined(NETBSD) #define _PRSockOptVal_t void * #else #error "Cannot determine architecture" @@ -3428,6 +3428,15 @@ if (osfd == -1) pt_MapError(_PR_MD_MAP_SOCKET_ERROR, errno); else { +#if defined(__NetBSD__) && defined(_PR_INET6) && defined(IPV6_V6ONLY) + if(domain == PR_AF_INET6) { + int opt = 0; + if (setsockopt(osfd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt))){ + close(osfd); + return NULL; + } + } +#endif fd = pt_SetMethods(osfd, ftype, PR_FALSE, PR_FALSE); if (fd == NULL) close(osfd); }