Add IPv6 patch, avoid calling setsockopt on non-IPv6 sockets

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/gsoap?expand=0&rev=12
This commit is contained in:
Jan Engelhardt 2011-11-10 16:06:21 +00:00 committed by Git OBS Bridge
parent b8a0ebfbf3
commit a0ff782b2f
3 changed files with 37 additions and 2 deletions

32
gsoap-05-ipv6.diff Normal file
View File

@ -0,0 +1,32 @@
From: Jan Engelhardt <jengelh@medozas.de>
Date: 2011-11-10 16:47:10.249693116 +0100
Upstream: tbd
IPPROTO_IPV6 socket options must only be applied to AF_INET6 sockets
(it fails otherwise).
---
gsoap/stdsoap2.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: gsoap-2.8.4/gsoap/stdsoap2.cpp
===================================================================
--- gsoap-2.8.4.orig/gsoap/stdsoap2.cpp
+++ gsoap-2.8.4/gsoap/stdsoap2.cpp
@@ -4685,14 +4685,14 @@ soap_bind(struct soap *soap, const char
#endif
#ifdef WITH_IPV6
#ifdef WITH_IPV6_V6ONLY
- if (setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&set, sizeof(int)))
+ if (res.ai_family == AF_INET6 && setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&set, sizeof(int)) < 0)
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt set IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
#endif
#ifdef WITH_NO_IPV6_V6ONLY
- if (setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&unset, sizeof(int)))
+ if (res.ai_family == AF_INET6 && setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&unset, sizeof(int)) < 0)
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt unset IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;

View File

@ -11,6 +11,8 @@ Thu Nov 10 11:40:07 UTC 2011 - jengelh@medozas.de
soap_wsse_add_EncryptedKey_encrypt_only).
* Improved HTTP proxy authentication support (digest and NTLM).
- Added patch to fix empty error strings (gsoap-04-strerror.diff)
- Added patch to avoid calling IPv6-only socket options on non-IPv6
sockets (gsoap-05-ipv6.diff)
-------------------------------------------------------------------
Tue Oct 18 15:39:46 UTC 2011 - jengelh@medozas.de

View File

@ -13,6 +13,7 @@ Patch1: gsoap-01-sharedlibs.diff
Patch2: gsoap-02-typepuns.diff
Patch3: gsoap-03-initext.diff
Patch4: gsoap-04-strerror.diff
Patch5: gsoap-05-ipv6.diff
BuildRoot: %_tmppath/%name-%version-build
BuildRequires: bison, fdupes flex, gcc-c++, pkgconfig
%if 0%{?suse_version} >= 1130
@ -78,13 +79,13 @@ symlinks for libgsoap.
tar -xf "%{S:0}" --use=xz;
%setup -DTq
%endif
%patch -P 1 -P 2 -P 3 -P 4 -p1
%patch -P 1 -P 2 -P 3 -P 4 -P 5 -p1
%build
# Rebuild configure - fix that utterly long mktime test.
autoreconf -fi;
%configure --enable-ipv6 --disable-static CFLAGS="-O0 -ggdb3" CXXFLAGS="-O0 -ggdb3"
%configure --enable-ipv6 --disable-static CFLAGS="-O0 -ggdb3 -DWITH_NO_IPV6_V6ONLY" CXXFLAGS="-O0 -ggdb3 -DWITH_NO_IPV6_V6ONLY"
pushd gsoap/src/;
make soapcpp2_yacc.c;
popd;