From owner-cvs-all Sat Dec 22 7: 2:40 2001 Delivered-To: cvs-all@freebsd.org Received: from cheer.mahoroba.org (flets-c0109.kamome.or.jp [211.8.151.237]) by hub.freebsd.org (Postfix) with ESMTP id 498D337B405; Sat, 22 Dec 2001 07:02:21 -0800 (PST) Received: from fiva.mahoroba.org (ume@piano-wi.mahoroba.org [IPv6:2001:200:301:0:260:1dff:fe22:dd55]) (user=ume mech=CRAM-MD5 bits=0) by cheer.mahoroba.org (8.12.1/8.12.1) with ESMTP/inet6 id fBMF2BBF054263; Sun, 23 Dec 2001 00:02:12 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sun, 23 Dec 2001 00:02:11 +0900 Message-ID: From: Hajimu UMEMOTO To: John Hay Cc: mheffner@vt.edu (Mike Heffner), mikeh@FreeBSD.ORG (Mike Heffner), cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, FreeBSD-current@FreeBSD.ORG (FreeBSD-current) Subject: Re: cvs commit: src/usr.bin/ftp Makefile cmds.c cmdtab.c complet In-Reply-To: <200112140643.fBE6hod26370@zibbi.icomtek.csir.co.za> References: <200112140643.fBE6hod26370@zibbi.icomtek.csir.co.za> User-Agent: xcite1.38> Wanderlust/2.9.0 (Unchained Melody) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.1 (i386--freebsd) MULE/5.0 (=?ISO-2022-JP?B?GyRCOC1MWhsoQg==?=) X-Operating-System: FreeBSD 5.0-CURRENT MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS-perl11-milter (http://amavis.org/) Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, >>>>> On Fri, 14 Dec 2001 08:43:49 +0200 (SAT) >>>>> John Hay said: > On 13-Dec-2001 Mike Heffner wrote: > | mikeh 2001/12/13 15:46:45 PST jhay> ... > | Log: > | Connect lukemftp to the build as the default ftp client. Lukemftp > | supports most of the previous features of FreeBSD ftp, but has been > | better maintained and includes new features. > > Short summary of differences: > jhay> ... > Differences/Losses: > > *) FTP_PASSIVE_MODE vs. FTP_MODE > *) -4/-6 for forcing IPV4/IPV6 jhay> Any chance of getting -4/-6 or something like it, back? It is very useful jhay> here in our environment that have a lot of dual-stack machines. I think it is still useful in the environment where IPv6 link is relatively slow than IPv4 link. How about this patch? Index: contrib/lukemftp/src/fetch.c =================================================================== RCS file: /home/ncvs/src/contrib/lukemftp/src/fetch.c,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 fetch.c --- contrib/lukemftp/src/fetch.c 19 Jul 2001 16:26:13 -0000 1.1.1.1 +++ contrib/lukemftp/src/fetch.c 22 Dec 2001 14:47:28 -0000 @@ -617,7 +617,7 @@ memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; - hints.ai_family = AF_UNSPEC; + hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; error = getaddrinfo(host, NULL, &hints, &res0); Index: contrib/lukemftp/src/ftp.1 =================================================================== RCS file: /home/ncvs/src/contrib/lukemftp/src/ftp.1,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 ftp.1 --- contrib/lukemftp/src/ftp.1 19 Jul 2001 16:26:13 -0000 1.1.1.1 +++ contrib/lukemftp/src/ftp.1 22 Dec 2001 14:47:29 -0000 @@ -77,7 +77,7 @@ Internet file transfer program .Sh SYNOPSIS .Nm "" -.Op Fl AadefginpRtvV +.Op Fl 46AadefginpRtvV .Bk -words .Op Fl o Ar output .Ek @@ -146,6 +146,14 @@ Options may be specified at the command line, or to the command interpreter. .Bl -tag -width "port " +.It Fl 4 +Forces +.Nm +to use IPv4 addresses only. +.It Fl 6 +Forces +.Nm +to use IPv6 addresses only. .It Fl A Force active mode ftp. By default, Index: contrib/lukemftp/src/ftp.c =================================================================== RCS file: /home/ncvs/src/contrib/lukemftp/src/ftp.c,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 ftp.c --- contrib/lukemftp/src/ftp.c 19 Jul 2001 16:26:14 -0000 1.1.1.1 +++ contrib/lukemftp/src/ftp.c 22 Dec 2001 14:47:31 -0000 @@ -149,7 +149,7 @@ memset(&hints, 0, sizeof(hints)); portnum = parseport(port, FTP_PORT); hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; + hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; error = getaddrinfo(host, NULL, &hints, &res0); Index: contrib/lukemftp/src/ftp_var.h =================================================================== RCS file: /home/ncvs/src/contrib/lukemftp/src/ftp_var.h,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 ftp_var.h --- contrib/lukemftp/src/ftp_var.h 19 Jul 2001 16:26:14 -0000 1.1.1.1 +++ contrib/lukemftp/src/ftp_var.h 22 Dec 2001 14:47:31 -0000 @@ -279,6 +279,8 @@ GLOBAL char remotepwd[MAXPATHLEN]; /* remote dir */ GLOBAL char *username; /* name of user logged in as. (dynamic) */ +GLOBAL sa_family_t family; /* address family to use for connections */ + GLOBAL char *ftpport; /* port number to use for FTP connections */ GLOBAL char *httpport; /* port number to use for HTTP connections */ GLOBAL char *gateport; /* port number to use for gateftp connections */ Index: contrib/lukemftp/src/main.c =================================================================== RCS file: /home/ncvs/src/contrib/lukemftp/src/main.c,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 main.c --- contrib/lukemftp/src/main.c 19 Jul 2001 16:26:14 -0000 1.1.1.1 +++ contrib/lukemftp/src/main.c 22 Dec 2001 14:47:32 -0000 @@ -171,6 +171,7 @@ upload_path = NULL; isupload = 0; reply_callback = NULL; + family = AF_UNSPEC; /* * Get the default socket buffer sizes if we don't already have them. @@ -255,8 +256,16 @@ } } - while ((ch = getopt(argc, argv, "Aadefgino:pP:r:RtT:u:vV")) != -1) { + while ((ch = getopt(argc, argv, "46Aadefgino:pP:r:RtT:u:vV")) != -1) { switch (ch) { + case '4': + family = AF_INET; + break; + + case '6': + family = AF_INET6; + break; + case 'A': activefallback = 0; passivemode = 0; -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message