diff options
author | Nathan Straz <nstraz@redhat.com> | 2012-04-19 16:44:23 -0500 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2012-04-19 16:44:23 -0500 |
commit | 38b386e963511a005e66222c559c112450f0356b (patch) | |
tree | 7144cbd6136320bf3ad0792c6d6250620ccda71c /sockutil.c | |
parent | 3e86ffe24bdf6fa55a85192d9818d0bc963c7f0f (diff) | |
download | qarsh-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |