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

Unified Diff: webrtc/base/network.cc

Issue 1471203002: GetDefaultLocalAddress should return false when the address is invalid (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 1 month 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 | webrtc/base/network_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/network.cc
diff --git a/webrtc/base/network.cc b/webrtc/base/network.cc
index f35dcbacf814cf41393f79be6df622891fa512f7..678541d0b11025b0d8e17023828cc479c000026b 100644
--- a/webrtc/base/network.cc
+++ b/webrtc/base/network.cc
@@ -345,10 +345,10 @@ void NetworkManagerBase::set_default_local_addresses(const IPAddress& ipv4,
bool NetworkManagerBase::GetDefaultLocalAddress(int family,
IPAddress* ipaddr) const {
- if (family == AF_INET) {
+ if (family == AF_INET && !default_local_ipv4_address_.IsNil()) {
*ipaddr = default_local_ipv4_address_;
return true;
- } else if (family == AF_INET6) {
+ } else if (family == AF_INET6 && !default_local_ipv6_address_.IsNil()) {
*ipaddr = default_local_ipv6_address_;
return true;
}
« no previous file with comments | « no previous file | webrtc/base/network_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698