1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Add some hard-coded textual literal-IP representations of localhost to

sk_hostname_is_local(), to catch the case where we're doing something like X11
forwarding over SSH through a proxy, and we've thus disabled local lookup of
hostnames.
(I think this is what's behind the report in
<e9a86996-5dc2-4428-9b0c-c65693ca6351@m32g2000hsf.googlegroups.com>
in comp.security.ssh, although I'd like to know more of the circumstances.)

[originally from svn r8385]
This commit is contained in:
Jacob Nevins 2009-01-05 02:45:38 +00:00
parent 51bceb0c9a
commit bd5cec280a
2 changed files with 6 additions and 2 deletions

View File

@ -326,7 +326,9 @@ void sk_getaddr(SockAddr addr, char *buf, int buflen)
int sk_hostname_is_local(char *name) 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) \ #define ipv4_is_loopback(addr) \

View File

@ -602,7 +602,9 @@ void sk_getaddr(SockAddr addr, char *buf, int buflen)
int sk_hostname_is_local(char *name) int sk_hostname_is_local(char *name)
{ {
return !strcmp(name, "localhost"); return !strcmp(name, "localhost") ||
!strcmp(name, "::1") ||
!strncmp(name, "127.", 4);
} }
static INTERFACE_INFO local_interfaces[16]; static INTERFACE_INFO local_interfaces[16];