Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: webrtc/p2p/client/basicportallocator.cc

Issue 2206713004: Do not create incompatible TurnPort if the server address family is known. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 658bac3e88f76114525c0afa044575551b4df31c..bffd70a492e8aa7e97403295347ba66a3c21b0b9 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -1296,6 +1296,19 @@ void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) {
continue;
}
+ // Do not create a port if the server address family is known and does
+ // not match the local IP address family.
+ int server_ip_family = relay_port->address.ipaddr().family();
+ int local_ip_family = network_->GetBestIP().family();
Taylor Brandstetter 2016/08/05 20:31:29 Can just use ip_.family().
honghaiz3 2016/08/05 22:04:07 Done.
+ if (server_ip_family != AF_UNSPEC && server_ip_family != local_ip_family) {
pthatcher1 2016/08/03 21:33:08 What happens if local_ip_family is AF_UNSPEC and s
Taylor Brandstetter 2016/08/05 20:31:29 I agree about this. Even if it's not possible to b
honghaiz3 2016/08/05 22:04:07 It is possible (although very strange) to have a n
Taylor Brandstetter 2016/08/05 22:19:26 Ok, makes sense. So we actually do want to treat A
+ LOG(LS_INFO) << "Server and local address families are not compatible. "
+ << "Server address: "
+ << relay_port->address.ipaddr().ToString()
+ << " Local address: " << network_->GetBestIP().ToString();
+ continue;
+ }
+
+
// Shared socket mode must be enabled only for UDP based ports. Hence
// don't pass shared socket for ports which will create TCP sockets.
// TODO(mallinath) - Enable shared socket mode for TURN ports. Disabled
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698