Changeset 231235 in webkit


Ignore:
Timestamp:
May 2, 2018 9:42:10 AM (6 years ago)
Author:
youenn@apple.com
Message:

Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
https://bugs.webkit.org/show_bug.cgi?id=181009
<rdar://problem/36144555>

Reviewed by Eric Carlson.

On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
No error is raised which leads to sending STUN requests with that IP address.
Once the request times out, the ICE candidate gathering finishes with host candidates only.

This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
STUN is used for NAT traversal which is for IPv4 addresses.
Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.

Manually tested on iOS with IPv4/IPv6 and IPv6 networks.

  • NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:

(WebKit::resolvedName):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r231234 r231235  
     12018-05-02  Youenn Fablet  <youenn@apple.com>
     2
     3        Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
     4        https://bugs.webkit.org/show_bug.cgi?id=181009
     5        <rdar://problem/36144555>
     6
     7        Reviewed by Eric Carlson.
     8
     9        On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
     10        No error is raised which leads to sending STUN requests with that IP address.
     11        Once the request times out, the ICE candidate gathering finishes with host candidates only.
     12
     13        This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
     14        STUN is used for NAT traversal which is for IPv4 addresses.
     15        Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.
     16
     17        Manually tested on iOS with IPv4/IPv6 and IPv6 networks.
     18
     19        * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
     20        (WebKit::resolvedName):
     21
    1222018-05-02  Youenn Fablet  <youenn@apple.com>
    223
  • trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp

    r229359 r231235  
    5757        CFDataRef data = (CFDataRef)CFArrayGetValueAtIndex(resolvedAddresses, index);
    5858        auto* address = reinterpret_cast<const struct sockaddr_in*>(CFDataGetBytePtr(data));
    59         addresses.uncheckedAppend(WebCore::IPAddress(*address));
     59        if (address->sin_family == AF_INET)
     60            addresses.uncheckedAppend(WebCore::IPAddress(*address));
     61        // FIXME: We should probably return AF_INET6 addresses as well.
     62    }
     63    if (addresses.isEmpty()) {
     64        resolver->completed(makeUnexpected(WebCore::DNSError::CannotResolve));
     65        return;
    6066    }
    6167    resolver->completed(WTFMove(addresses));
Note: See TracChangeset for help on using the changeset viewer.