From 2055a9b0e141eba5d70781c2eb9a78dd11fea157 Mon Sep 17 00:00:00 2001 From: Nimrod Maclomhair Date: Tue, 14 Feb 2023 18:48:35 +0100 Subject: [PATCH] Make the ncat http proxy listen only on the specified address --- ncat/ncat_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ncat/ncat_main.c b/ncat/ncat_main.c index f62c8d964..b7dea3f06 100644 --- a/ncat/ncat_main.c +++ b/ncat/ncat_main.c @@ -887,10 +887,10 @@ int main(int argc, char *argv[]) } } o.target = argv[optind]; - /* resolve hostname only if o.proxytype == NULL + /* resolve hostname only if o.proxytype == NULL or o.listen == 1 * targetss contains data already and you don't want remove them */ - if( !o.proxytype + if( (!o.proxytype || o.listen) && (rc = resolve_multi(o.target, 0, targetaddrs, o.af)) != 0) bye("Could not resolve hostname \"%s\": %s.", o.target, gai_strerror(rc));