summaryrefslogtreecommitdiff
path: root/src/common/address.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/address.c')
-rw-r--r--src/common/address.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/address.c b/src/common/address.c
index 7f78d1e4d3..e444ef1934 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -1687,3 +1687,12 @@ get_interface_address(int severity, uint32_t *addr)
return r;
}
+/** Return true if we can tell that <b>name</b> is a canonical name for the
+ * loopback address. */
+int
+tor_addr_hostname_is_local(const char *name)
+{
+ return !strcasecmp(name, "localhost") ||
+ !strcasecmp(name, "local") ||
+ !strcasecmpend(name, ".local");
+}