Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[CVS] OpenSSL: openssl/crypto/bio/ b_sock.c bss_dgram.c openssl/ e_os....

5 views
Skip to first unread message

Dr. Stephen Henson

unread,
Aug 26, 2009, 12:08:49 PM8/26/09
to
OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________________________

Server: cvs.openssl.org Name: Dr. Stephen Henson
Root: /v/openssl/cvs Email: st...@openssl.org
Module: openssl Date: 26-Aug-2009 17:15:15
Branch: HEAD Handle: 2009082616151401

Modified files:
openssl e_os.h
openssl/crypto/bio b_sock.c bss_dgram.c

Log:
PR: 2005
Submitted by: st...@openssl.org

Some systems have broken IPv6 headers and/or implementations. If
OPENSSL_USE_IPV6 is set to 0 IPv6 is not used, if it is set to 1 it is used
and if undefined an attempt is made to detect at compile time by checking
if AF_INET6 is set and excluding known problem platforms.

Summary:
Revision Changes Path
1.52 +2 -7 openssl/crypto/bio/b_sock.c
1.21 +4 -0 openssl/crypto/bio/bss_dgram.c
1.100 +12 -0 openssl/e_os.h
____________________________________________________________________________

patch -p0 <<'@@ .'
Index: openssl/crypto/bio/b_sock.c
============================================================================
$ cvs diff -u -r1.51 -r1.52 b_sock.c
--- openssl/crypto/bio/b_sock.c 26 Apr 2009 18:06:14 -0000 1.51
+++ openssl/crypto/bio/b_sock.c 26 Aug 2009 15:15:15 -0000 1.52
@@ -88,11 +88,6 @@
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;
@@ -654,7 +649,7 @@
if (strchr(h,':'))
{
if (h[1]=='\0') h=NULL;
-#ifdef AF_INET6
+#if OPENSSL_USE_IPV6
hint.ai_family = AF_INET6;
#else
h=NULL;
@@ -720,7 +715,7 @@
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 =
@@ .
patch -p0 <<'@@ .'
Index: openssl/crypto/bio/bss_dgram.c
============================================================================
$ cvs diff -u -r1.20 -r1.21 bss_dgram.c
--- openssl/crypto/bio/bss_dgram.c 24 Jul 2009 13:07:30 -0000 1.20
+++ openssl/crypto/bio/bss_dgram.c 26 Aug 2009 15:15:15 -0000 1.21
@@ -429,12 +429,14 @@
&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;
@@ -470,6 +472,7 @@
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)
@@ -485,6 +488,7 @@
ret = data->mtu;
}
break;
+#endif
default:
ret = 0;
break;
@@ .
patch -p0 <<'@@ .'
Index: openssl/e_os.h
============================================================================
$ cvs diff -u -r1.99 -r1.100 e_os.h
--- openssl/e_os.h 20 Apr 2009 11:33:07 -0000 1.99
+++ openssl/e_os.h 26 Aug 2009 15:15:14 -0000 1.100
@@ -624,6 +624,18 @@
# 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)
@@ .
______________________________________________________________________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List opens...@openssl.org
Automated List Manager majo...@openssl.org

0 new messages