Use AF_INET instead of AF_UNSPEC as the default family if !defined(INET6).

Avoids problem reported by Matthias Scheler <tron@NetBSD.org>.
This commit is contained in:
lukem 2008-08-13 04:59:13 +00:00
parent 47d577b299
commit 4f152bac9e
3 changed files with 11 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.111 2008/07/21 23:11:16 lukem Exp $ */
/* $NetBSD: main.c,v 1.112 2008/08/13 04:59:13 lukem Exp $ */
/*-
* Copyright (c) 1996-2008 The NetBSD Foundation, Inc.
@ -98,7 +98,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
__RCSID("$NetBSD: main.c,v 1.111 2008/07/21 23:11:16 lukem Exp $");
__RCSID("$NetBSD: main.c,v 1.112 2008/08/13 04:59:13 lukem Exp $");
#endif
#endif /* not lint */
@ -192,7 +192,11 @@ main(int volatile argc, char **volatile argv)
upload_path = NULL;
isupload = 0;
reply_callback = NULL;
#ifdef INET6
family = AF_UNSPEC;
#else
family = AF_INET; /* force AF_INET if no INET6 support */
#endif
netrc[0] = '\0';
cp = getenv("NETRC");

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.147 2008/05/10 00:05:31 skd Exp $ */
/* $NetBSD: util.c,v 1.148 2008/08/13 04:59:13 lukem Exp $ */
/*-
* Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: util.c,v 1.147 2008/05/10 00:05:31 skd Exp $");
__RCSID("$NetBSD: util.c,v 1.148 2008/08/13 04:59:13 lukem Exp $");
#endif /* not lint */
/*
@ -1215,7 +1215,7 @@ isipv6addr(const char *addr)
struct addrinfo hints, *res;
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_INET6;
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo(addr, "0", &hints, &res) != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.h,v 1.76 2008/05/10 01:14:57 skd Exp $ */
/* $NetBSD: version.h,v 1.77 2008/08/13 04:59:13 lukem Exp $ */
/*-
* Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
@ -34,5 +34,5 @@
#endif
#ifndef FTP_VERSION
#define FTP_VERSION "20080509"
#define FTP_VERSION "20080813"
#endif