static int wsa_init_done=0;
#endif
-#if defined(OPENSSL_SYS_BEOS_BONE)
-/* BONE's IP6 support is incomplete */
-#undef AF_INET6
-#endif
-
#if 0
static unsigned long BIO_ghbn_hits=0L;
static unsigned long BIO_ghbn_miss=0L;
if (strchr(h,':'))
{
if (h[1]=='\0') h=NULL;
-#ifdef AF_INET6
+#if OPENSSL_USE_IPV6
hint.ai_family = AF_INET6;
#else
h=NULL;
client = server;
if (h == NULL || strcmp(h,"*") == 0)
{
-#ifdef AF_INET6
+#if OPENSSL_USE_IPV6
if (client.sa_family == AF_INET6)
{
struct sockaddr_in6 *sin6 =
&sockopt_val, sizeof(sockopt_val))) < 0)
perror("setsockopt");
break;
+#if OPENSSL_USE_IPV6
case AF_INET6:
sockopt_val = IPV6_PMTUDISC_DO;
if ((ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_MTU_DISCOVER,
&sockopt_val, sizeof(sockopt_val))) < 0)
perror("setsockopt");
break;
+#endif
default:
ret = -1;
break;
ret = data->mtu;
}
break;
+#if OPENSSL_USE_IPV6
case AF_INET6:
if ((ret = getsockopt(b->num, IPPROTO_IPV6, IPV6_MTU, (void *)&sockopt_val,
&sockopt_len)) < 0 || sockopt_val < 0)
ret = data->mtu;
}
break;
+#endif
default:
ret = 0;
break;
# define INVALID_SOCKET (-1)
# endif /* INVALID_SOCKET */
# endif
+
+/* Some IPv6 implementations are broken, disable them in known bad
+ * versions.
+ */
+# if !defined(OPENSSL_USE_IPV6)
+# if defined(AF_INET6) && !defined(OPENSSL_SYS_BEOS_BONE) && !defined(NETWARE_CLIB)
+# define OPENSSL_USE_IPV6 1
+# else
+# define OPENSSL_USE_IPV6 0
+# endif
+# endif
+
#endif
#if defined(__ultrix)