only use getaddrinfo() et al if both NI_NUMERICHOST *and* INET6 are defined...
(allows --disable-ipv6 in lukemftp's configure script to disable this as well, which is good for testing when it appears getaddrinfo() is borken)
This commit is contained in:
parent
fd8c03cf44
commit
b5df4bcc84
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fetch.c,v 1.104 2000/01/31 22:01:04 lukem Exp $ */
|
||||
/* $NetBSD: fetch.c,v 1.105 2000/02/14 21:46:26 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-1999 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: fetch.c,v 1.104 2000/01/31 22:01:04 lukem Exp $");
|
||||
__RCSID("$NetBSD: fetch.c,v 1.105 2000/02/14 21:46:26 lukem Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -451,7 +451,7 @@ fetch_url(url, proxyenv, proxyauth, wwwauth)
|
||||
char *proxyauth;
|
||||
char *wwwauth;
|
||||
{
|
||||
#ifdef NI_NUMERICHOST
|
||||
#if defined(NI_NUMERICHOST) && defined(INET6)
|
||||
struct addrinfo hints, *res, *res0 = NULL;
|
||||
int error;
|
||||
char hbuf[NI_MAXHOST];
|
||||
@ -665,7 +665,7 @@ fetch_url(url, proxyenv, proxyauth, wwwauth)
|
||||
}
|
||||
} /* ! EMPTYSTRING(proxyenv) */
|
||||
|
||||
#ifndef NI_NUMERICHOST
|
||||
#if !defined(NI_NUMERICHOST) || !defined(INET6)
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ftp.c,v 1.90 2000/01/31 22:01:04 lukem Exp $ */
|
||||
/* $NetBSD: ftp.c,v 1.91 2000/02/14 21:46:27 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
|
||||
@ -103,7 +103,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: ftp.c,v 1.90 2000/01/31 22:01:04 lukem Exp $");
|
||||
__RCSID("$NetBSD: ftp.c,v 1.91 2000/02/14 21:46:27 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -186,7 +186,7 @@ hookup(host, port)
|
||||
char *port;
|
||||
{
|
||||
int s = -1, len, error;
|
||||
#ifdef NI_NUMERICHOST
|
||||
#if defined(NI_NUMERICHOST) && defined(INET6)
|
||||
struct addrinfo hints, *res, *res0;
|
||||
char hbuf[MAXHOSTNAMELEN];
|
||||
#else
|
||||
@ -199,7 +199,7 @@ hookup(host, port)
|
||||
char *cause = "unknown";
|
||||
int family;
|
||||
|
||||
#ifdef NI_NUMERICHOST
|
||||
#if defined(NI_NUMERICHOST) && defined(INET6)
|
||||
memset((char *)&hisctladdr, 0, sizeof (hisctladdr));
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
|
Loading…
Reference in New Issue
Block a user