From c22063c43158bc2ff099d41db98f0c0f73ac3422 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 27 Aug 2013 10:41:49 -0700 Subject: [PATCH] sim_sock.c allow validation address to match various forms of literal localhost addresses. --- sim_sock.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sim_sock.c b/sim_sock.c index 79834d24..81ac5da8 100644 --- a/sim_sock.c +++ b/sim_sock.c @@ -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;