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

Unified Diff: net/base/net_util.h

Issue 1177933002: Resolve RFC 6761 localhost names to loopback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rsleevi, mmenke comments Created 5 years, 6 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 | net/base/net_util.cc » ('j') | net/dns/host_resolver_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.h
diff --git a/net/base/net_util.h b/net/base/net_util.h
index f2ba404ffddcb18a6bc433fabe7ad1e2991924d5..92b11c11132cdc4156a43a1609c42776924fa025 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -354,6 +354,13 @@ const uint16_t* GetPortFieldFromSockaddr(const struct sockaddr* address,
NET_EXPORT_PRIVATE int GetPortFromSockaddr(const struct sockaddr* address,
socklen_t address_len);
+// Returns true if |host| is one of the names (e.g. "localhost") that
+// indicate a loopback. Sets |isLocalhost6| to true if |host| is one of
+// the special names (e.g. "localhost6") that indicates an IPv6
+// loopback.
+NET_EXPORT_PRIVATE bool IsLocalhostHostname(const std::string& host,
+ bool* isLocalhost6);
+
// Returns true if |host| is one of the names (e.g. "localhost") or IP
// addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback.
//
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | net/dns/host_resolver_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698