1
0
mirror of https://github.com/simh/simh.git synced 2026-02-14 11:55:51 +00:00

sim_sock.c allow validation address to match various forms of literal localhost addresses.

This commit is contained in:
Mark Pizzolato
2013-08-27 10:41:49 -07:00
parent 8555bbb323
commit c22063c431

View File

@@ -610,6 +610,14 @@ if (validate_addr) {
break;
}
}
if (status != SCPE_OK) {
/* be generous and allow successful validations against variations of localhost addresses */
if (((0 == strcmp("127.0.0.1", hostp)) &&
(0 == strcmp("::1", validate_addr))) ||
((0 == strcmp("127.0.0.1", validate_addr)) &&
(0 == strcmp("::1", hostp))))
status = SCPE_OK;
}
p_freeaddrinfo (ai_host);
p_freeaddrinfo (ai_validate);
return status;