soap_bind() fails when compiled with IPv6 support
Development toolkit for Web Services and XML data bindings for C & C++
Brought to you by:
engelen
Platform: GNU/Linux (Fedora 20)
When gSOAP is compiled with --enable-ipv6 flag, soap_bind() fails.
Relevant error message:
Error 28 fault: SOAP-ENV:Server [no subcode]
"Protocol not available"
Detail: setsockopt unset IPV6_V6ONLY failed in soap_bind()
It happens because the function setsockopt(socket, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&unset, sizeof(int))) is called on an AF_INET socket and not on an AF_INET6 socket.
The patch quoted in comments of bug [#959] solves the issue.
I can't explain why on my computer getaddrinfo() returns an AF_INET socket to 0.0.0.0 and not an AF_INET6 socket to :: whereas provided hint.ai_family is AF_UNSPEC
netstat shows that OpenSSH listens on both 0.0.0.0:22 and :::22 so it seems IPv6 is correctly enabled on my machine.
This problem will be fixed in the upcoming 2.8.18 release available soon.