Menu

#959 IPv6-enabled client fails to connect to IPv4-only hosts

v1.0 (example)
closed-fixed
None
5
2014-08-24
2014-01-16
No

tcp_connect in stdsoap2.cpp calls

err = getaddrinfo(host, soap_int2s(soap, port), &hints, &res);

and later

#ifdef WITH_IPV6
    if (connect(sk, res->ai_addr, (int)res->ai_addrlen))

However, when the connect call returns ECONNREFUSED - which is possible if a server process listens on IPv4 only -, gsoap will not attempt to try res->ai_next.

Related

Bugs: #966

Discussion

  • Mattias Ellert

    Mattias Ellert - 2014-07-10

    A patch based on the above mentioned opensuse patch.

     
  • Robert Scheck

    Robert Scheck - 2014-08-03

    I am very sorry, but this patch is IMHO not the ultimate answer for this issue.

    Fedora is shipping gSOAP with IPv6 enabled as part of the distribution; system itself is dual-stacked for example. If now a software, in this case Zarafa, is linked against the system gSOAP it tries to connect using tcp_connect() always to IPv6 (if the DNS name resolves to IPv6 (and IPv4)). Looking into it using strace(1) the connect() call to ::1 returns EINPROGRESS but the SOAP server is not IPv6 enabled (not listening on IPv6, just IPv4). There is no retry afterwards using IPv4 (like telnet(1) does) and I wasn't able to find a run-time option (but I might be wrong with last).

     
  • Robert van Engelen

    Very interesting observations and thanks for the discussion!

    The improvements will be available in the upcoming 2.8.18 release.

     
  • Robert van Engelen

    Sorry, but "Remove pointless casts to void *; this implicit even in C++." might be true from a purist standards point of view, but we ran into C compilers that produced warnings! We're also getting type punning warnings (in other places, and no... there are no aliases to worry about), so sprinkling (void*) here and there is ugly but ensures the intended implementation works. I don't want users to get annoyed when they can no longer compile the code on their (legacy) system.

     
  • Jan Engelhardt

    Jan Engelhardt - 2014-08-18

    we ran into C compilers that produced warnings!

    Are you still building with compilers that don't understand ANSI C?

     
  • Robert van Engelen

    • status: open --> pending-fixed
     
  • Robert van Engelen

    Are you still building with compilers that don't understand ANSI C?

    Yep, blame me for taking our users very seriously and not treat them the cold shoulder. We have folks that still need support for DOS, VAX, Tandem and several embedded platforms that require both old and new stuff to work.

    I have seen it all, working 20+ years with C/C++. Worst offenders are/used to be compilers from proprietary vendors.

     
  • Robert van Engelen

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB