=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshconnect.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/usr.bin/ssh/sshconnect.c 1999/10/03 22:01:39 1.13 +++ src/usr.bin/ssh/sshconnect.c 1999/10/04 19:46:30 1.14 @@ -15,7 +15,7 @@ */ #include "includes.h" -RCSID("$Id: sshconnect.c,v 1.13 1999/10/03 22:01:39 provos Exp $"); +RCSID("$Id: sshconnect.c,v 1.14 1999/10/04 19:46:30 provos Exp $"); #include #include "xmalloc.h" @@ -1104,15 +1104,17 @@ and the user will get bogus HOST_CHANGED warnings. This essentially disables host authentication for localhost; however, this is probably not a real problem. */ - if (strcmp(host, "localhost") == 0 || - strcmp(host, "127.0.0.1") == 0) + if (strcmp(inet_ntoa(hostaddr->sin_addr), "127.0.0.1") == 0) { debug("Forcing accepting of host key for localhost."); host_status = HOST_OK; } - /* Also perform check for the ip address */ - if (options->check_host_ip && strcmp(host, inet_ntoa(hostaddr->sin_addr))) { + /* Also perform check for the ip address, skip the check if we are + localhost or the hostname was an ip address to begin with */ + if (options->check_host_ip && + strcmp(inet_ntoa(hostaddr->sin_addr), "127.0.0.1") && + strcmp(host, inet_ntoa(hostaddr->sin_addr))) { RSA *ip_key = RSA_new(); ip_key->n = BN_new(); ip_key->e = BN_new();