From 38b386e963511a005e66222c559c112450f0356b Mon Sep 17 00:00:00 2001 From: Nathan Straz Date: Thu, 19 Apr 2012 16:44:23 -0500 Subject: Pass hints into getaddrinfo Without the hints we could end up creating a non-stream socket which would cause qarsh to hang reading the packet in set_remote_user(). --- sockutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sockutil.c b/sockutil.c index 824f378..14a058d 100644 --- a/sockutil.c +++ b/sockutil.c @@ -111,7 +111,7 @@ connect_to_host(char *hostname, int port, unsigned short *ss_family) memset(portstr, 0, sizeof portstr); snprintf(portstr, NI_MAXSERV, "%d", port); - if ((err = getaddrinfo(hostname, portstr, NULL, &ail)) != 0) { + if ((err = getaddrinfo(hostname, portstr, &hints, &ail)) != 0) { fprintf(stderr, "Could not resolve hostname %s: %s\n", hostname, gai_strerror(err)); return -1; -- cgit