| Index: webrtc/pc/iceserverparsing.cc
|
| diff --git a/webrtc/pc/iceserverparsing.cc b/webrtc/pc/iceserverparsing.cc
|
| index 5769cee94e270e1448f139992c3833dc411d6a54..ac8764e0363a7683a4fc9ca83609b4291fd1bb7e 100644
|
| --- a/webrtc/pc/iceserverparsing.cc
|
| +++ b/webrtc/pc/iceserverparsing.cc
|
| @@ -210,8 +210,8 @@ static RTCErrorType ParseIceServerUrl(
|
| turn_transport_type = cricket::PROTO_TLS;
|
| }
|
|
|
| - std::string address;
|
| - if (!ParseHostnameAndPortFromString(hoststring, &address, &port)) {
|
| + std::string hostname;
|
| + if (!ParseHostnameAndPortFromString(hoststring, &hostname, &port)) {
|
| LOG(WARNING) << "Invalid hostname format: " << uri_without_transport;
|
| return RTCErrorType::SYNTAX_ERROR;
|
| }
|
| @@ -220,11 +220,18 @@ static RTCErrorType ParseIceServerUrl(
|
| LOG(WARNING) << "Invalid port: " << port;
|
| return RTCErrorType::SYNTAX_ERROR;
|
| }
|
| + rtc::SocketAddress address(hostname, port);
|
| + if (!server.ip.IsNil()) {
|
| + if (!address.IsUnresolvedIP() && address.ipaddr() != server.ip) {
|
| + return RTCErrorType::INVALID_PARAMETER;
|
| + }
|
| + address.SetResolvedIP(server.ip);
|
| + }
|
|
|
| switch (service_type) {
|
| case STUN:
|
| case STUNS:
|
| - stun_servers->insert(rtc::SocketAddress(address, port));
|
| + stun_servers->insert(address);
|
| break;
|
| case TURN:
|
| case TURNS: {
|
| @@ -234,7 +241,7 @@ static RTCErrorType ParseIceServerUrl(
|
| return RTCErrorType::INVALID_PARAMETER;
|
| }
|
| cricket::RelayServerConfig config = cricket::RelayServerConfig(
|
| - address, port, username, server.password, turn_transport_type);
|
| + address, username, server.password, turn_transport_type);
|
| if (server.tls_cert_policy ==
|
| PeerConnectionInterface::kTlsCertPolicyInsecureNoCheck) {
|
| config.tls_cert_policy =
|
|
|