When running this code in chromium on a machine with IPv6 disabled, the RTC_DCHECK fails and in release build, it could leak to further crash in chromium's rtc_peer_connection_hanlder.cc.
Here is the right fix.
BUG=webrtc:5061
R=pthatcher@google.com
TBR=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1437933002 .
Cr-Commit-Position: refs/heads/master@{#10607}
diff --git a/webrtc/p2p/base/stunport.h b/webrtc/p2p/base/stunport.h
index 6e7a239..ccd3f36 100644
--- a/webrtc/p2p/base/stunport.h
+++ b/webrtc/p2p/base/stunport.h
@@ -149,8 +149,10 @@
void SendStunBindingRequests();
// Helper function which will set |addr|'s IP to the default local address if
- // |addr| is the "any" address and |emit_local_for_anyaddress_| is true.
- void MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const;
+ // |addr| is the "any" address and |emit_local_for_anyaddress_| is true. When
+ // returning false, it indicates that the operation has failed and the
+ // address shouldn't be used by any candidate.
+ bool MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const;
private:
// A helper class which can be called repeatedly to resolve multiple