diff --git a/glorytun.c b/glorytun.c index 58c935f..ae30ddd 100644 --- a/glorytun.c +++ b/glorytun.c @@ -304,9 +304,11 @@ int main (int argc, char **argv) .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, .ai_protocol = IPPROTO_TCP, - .ai_flags = AI_PASSIVE, }; + if (listener) + hints.ai_flags = AI_PASSIVE; + struct addrinfo *ai = NULL; if (getaddrinfo(host, port, &hints, &ai)) {