Index: webrtc/p2p/base/basicpacketsocketfactory.cc |
diff --git a/webrtc/p2p/base/basicpacketsocketfactory.cc b/webrtc/p2p/base/basicpacketsocketfactory.cc |
index c478d6311202108bbaff642768508171aa1f9f06..22435753cbee1be7c3b091b5f7957903591c38b4 100644 |
--- a/webrtc/p2p/base/basicpacketsocketfactory.cc |
+++ b/webrtc/p2p/base/basicpacketsocketfactory.cc |
@@ -114,10 +114,16 @@ AsyncPacketSocket* BasicPacketSocketFactory::CreateClientTcpSocket( |
} |
if (BindSocket(socket, local_address, 0, 0) < 0) { |
- LOG(LS_ERROR) << "TCP bind failed with error " |
- << socket->GetError(); |
- delete socket; |
- return NULL; |
+ // Allow BindSocket to fail if we're binding to the ANY address anyway. The |
+ // socket will be bound when we call Connect() instead. |
+ if (local_address.IsAnyIP()) { |
+ LOG(LS_WARNING) << "TCP bind failed with error " << socket->GetError() |
+ << "; ignoring since socket is using 'any' address."; |
+ } else { |
+ LOG(LS_ERROR) << "TCP bind failed with error " << socket->GetError(); |
+ delete socket; |
+ return NULL; |
+ } |
} |
// If using a proxy, wrap the socket in a proxy socket. |