summaryrefslogtreecommitdiffstats
path: root/sockutil.c
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2012-04-19 16:44:23 -0500
committerNathan Straz <nstraz@redhat.com>2012-04-19 16:44:23 -0500
commit38b386e963511a005e66222c559c112450f0356b (patch)
tree7144cbd6136320bf3ad0792c6d6250620ccda71c /sockutil.c
parent3e86ffe24bdf6fa55a85192d9818d0bc963c7f0f (diff)
downloadqarsh-38b386e963511a005e66222c559c112450f0356b.tar.gz
qarsh-38b386e963511a005e66222c559c112450f0356b.tar.xz
qarsh-38b386e963511a005e66222c559c112450f0356b.zip
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().
Diffstat (limited to 'sockutil.c')
-rw-r--r--sockutil.c2
1 files changed, 1 insertions, 1 deletions
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;