Module Name: src Committed By: tron Date: Fri Dec 11 08:37:32 UTC 2015
Modified Files: src/usr.bin/ftp: fetch.c ftp.c Log Message: Use the proper format "[IPv6 address]:port" when reporting connection attempts to IPv6 endpoints. To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 src/usr.bin/ftp/fetch.c cvs rdiff -u -r1.164 -r1.165 src/usr.bin/ftp/ftp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/ftp/fetch.c diff -u src/usr.bin/ftp/fetch.c:1.207 src/usr.bin/ftp/fetch.c:1.208 --- src/usr.bin/ftp/fetch.c:1.207 Sat Sep 12 19:38:42 2015 +++ src/usr.bin/ftp/fetch.c Fri Dec 11 08:37:31 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fetch.c,v 1.207 2015/09/12 19:38:42 wiz Exp $ */ +/* $NetBSD: fetch.c,v 1.208 2015/12/11 08:37:31 tron Exp $ */ /*- * Copyright (c) 1997-2015 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: fetch.c,v 1.207 2015/09/12 19:38:42 wiz Exp $"); +__RCSID("$NetBSD: fetch.c,v 1.208 2015/12/11 08:37:31 tron Exp $"); #endif /* not lint */ /* @@ -763,8 +763,13 @@ fetch_url(const char *url, const char *p } if (verbose && res0->ai_next) { - fprintf(ttyout, "Trying %s:%s ...\n", - hname, sname); + if(res->ai_family == AF_INET6) { + fprintf(ttyout, "Trying [%s]:%s ...\n", + hname, sname); + } else { + fprintf(ttyout, "Trying %s:%s ...\n", + hname, sname); + } } s = socket(res->ai_family, SOCK_STREAM, Index: src/usr.bin/ftp/ftp.c diff -u src/usr.bin/ftp/ftp.c:1.164 src/usr.bin/ftp/ftp.c:1.165 --- src/usr.bin/ftp/ftp.c:1.164 Wed Jul 4 06:09:37 2012 +++ src/usr.bin/ftp/ftp.c Fri Dec 11 08:37:31 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.164 2012/07/04 06:09:37 is Exp $ */ +/* $NetBSD: ftp.c,v 1.165 2015/12/11 08:37:31 tron Exp $ */ /*- * Copyright (c) 1996-2009 The NetBSD Foundation, Inc. @@ -92,7 +92,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.164 2012/07/04 06:09:37 is Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.165 2015/12/11 08:37:31 tron Exp $"); #endif #endif /* not lint */ @@ -200,7 +200,13 @@ hookup(const char *host, const char *por } if (verbose && res0->ai_next) { /* if we have multiple possibilities */ - fprintf(ttyout, "Trying %s:%s ...\n", hname, sname); + if(res->ai_family == AF_INET6) { + fprintf(ttyout, "Trying [%s]:%s ...\n", hname, + sname); + } else { + fprintf(ttyout, "Trying %s:%s ...\n", hname, + sname); + } } s = socket(res->ai_family, SOCK_STREAM, res->ai_protocol); if (s < 0) {