2013-09-26 17:14:40 +02:00

24 lines
979 B
Plaintext

$NetBSD: patch-aa,v 1.1.1.1 2007/09/16 15:53:12 heinz Exp $
Provide hints for getaddrinfo(), otherwise there is not enough data
to determine the correct address information.
Works on NetBSD and Linux.
AF_UNSPEC could not be used because IPv6 address information confuses the
application.
--- src/hub.c.orig 2006-12-24 19:41:44.000000000 +0100
+++ src/hub.c
@@ -316,10 +316,11 @@ hub_new(const char *hostname, uint16_t p
hub_connect(&addr); /* Ignore errors */
} else {
char portstr[6];
+ struct addrinfo hints = { 0, AF_INET, SOCK_STREAM, 0, };
sprintf(portstr, "%" PRIu16, port);
screen_putf(_("Looking up IP address for %s\n"), quotearg(hostname));
- hub_lookup = add_lookup_request(hostname, portstr, NULL, hub_address_looked_up, xstrdup(hostname));
+ hub_lookup = add_lookup_request(hostname, portstr, &hints, hub_address_looked_up, xstrdup(hostname));
hub_state = DC_HUB_LOOKUP;
}
}