← Back to team overview

linuxdcpp-team team mailing list archive

[Bug 1245179] Re: Resolving addresses with A and AAAA entries may fail in some cases

 

The edit that you made is wrong so the problem remains.

If resolving the first address fails, lastError gets set. The client
will still continue with the other addresses and they may success, but
since the error was set, the function will throw. Maybe lastError isn't
a good name for it though. You either need to clear the error in case of
successful attempt, use a success bool, or just check if the IP was set
to avoid adding an extra bool  :p

** Changed in: dcplusplus
       Status: Fix Committed => New

-- 
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to DC++.
https://bugs.launchpad.net/bugs/1245179

Title:
  Resolving addresses with A and AAAA entries may fail in some cases

Status in DC++:
  New

Bug description:
  Consider the following case:

  1. The client tries to connect to an address that has both A and AAAA entries
  2. ::getaddrinfo returns the AAAA entry first
  3. The client tries to connect via IPv6 but there's no IPv6 connectivity available (or it doesn't work for other reasons)
  4. Socket::connect throws immediately instead of continuing with the A entry

  I haven't seen this happening on Windows because it doesn't seem to
  return the AAAA entry if there is no (public) IPv6 connectivity
  available. However, Linux systems seem to generally return the AAAA
  first by default, regardless of the available connectivity. The
  attached patch should fix this issue.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dcplusplus/+bug/1245179/+subscriptions


References