Add some hard-coded textual literal-IP representations of localhost to
[sgt/putty] / unix / uxnet.c
index c0f2471..96d3aa5 100644 (file)
@@ -326,7 +326,9 @@ void sk_getaddr(SockAddr addr, char *buf, int buflen)
 
 int sk_hostname_is_local(char *name)
 {
-    return !strcmp(name, "localhost");
+    return !strcmp(name, "localhost") ||
+          !strcmp(name, "::1") ||
+          !strncmp(name, "127.", 4);
 }
 
 #define ipv4_is_loopback(addr) \