From d2e8551efe6b78a429ed400b37ac8f86b81830ef Mon Sep 17 00:00:00 2001 From: Salvador Fandino Date: Tue, 2 Jun 2015 12:30:49 +0200 Subject: Simplify ParseListenOption Merge code paths. Use GetHostAddress to resolve the target host address instead of inet_aton. --- nxcomp/Loop.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp index 7e8b1ec62..aab5c356d 100644 --- a/nxcomp/Loop.cpp +++ b/nxcomp/Loop.cpp @@ -13571,25 +13571,17 @@ int ParseListenOption(int &address) // on localhost. // - if (control -> ProxyMode == proxy_server) - { - address = (int) inet_addr("127.0.0.1"); + if (loopbackBind || (control->ProxyMode == proxy_server)) { + address = htonl(INADDR_LOOPBACK); } else { - if ( loopbackBind ) - { - address = htonl(INADDR_LOOPBACK); - } - else - { - address = htonl(INADDR_ANY); - } + address = htonl(INADDR_ANY); } } else { - address = inet_addr(listenHost); + address = GetHostAddress(listenHost); } return 1; -- cgit v1.2.3