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

Unified Diff: webrtc/base/ipaddress.cc

Issue 2445933003: Fix "IsLoopbackIp" to cover all loopback addresses; not just 127.0.0.1. (Closed)
Patch Set: Created 4 years, 2 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 | webrtc/base/ipaddress_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/ipaddress.cc
diff --git a/webrtc/base/ipaddress.cc b/webrtc/base/ipaddress.cc
index b1d1265ae479ee4c97f106d2a52fabb0614ca897..c06a1a7b050a5a21efe45071c5f86a036da1de18 100644
--- a/webrtc/base/ipaddress.cc
+++ b/webrtc/base/ipaddress.cc
@@ -294,7 +294,7 @@ bool IPIsAny(const IPAddress& ip) {
bool IPIsLoopback(const IPAddress& ip) {
switch (ip.family()) {
case AF_INET: {
- return ip == IPAddress(INADDR_LOOPBACK);
+ return (ip.v4AddressAsHostOrderInteger() >> 24) == 127;
}
case AF_INET6: {
return ip == IPAddress(in6addr_loopback);
« no previous file with comments | « no previous file | webrtc/base/ipaddress_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698