summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2001-03-24 00:28:57 +0000
committerdes <des@FreeBSD.org>2001-03-24 00:28:57 +0000
commitbfaef3b3b9e81cd8473ce5a40cbd703c74aa6b87 (patch)
tree9e939cb4c61566ea608493480bd9ae063a090c7e /lib/libfetch
parent18efff07bea541ba94df6244cca8672615388f9d (diff)
downloadFreeBSD-src-bfaef3b3b9e81cd8473ce5a40cbd703c74aa6b87.zip
FreeBSD-src-bfaef3b3b9e81cd8473ce5a40cbd703c74aa6b87.tar.gz
Use high port range by default, and replace the 'h' option with an 'l' option
that forces the ftp code to use the low (default) port range instead.
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/fetch.36
-rw-r--r--lib/libfetch/ftp.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index 55ddd6e..ea7c9cd 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -316,9 +316,9 @@ If the
will be attempted.
.Pp
If the
-.Fa h
-(high) flag is specified, data sockets will be allocated in the high
-port range (see
+.Fa l
+(low) flag is specified, data sockets will be allocated in the low (or
+default) port range instead of the hifh port range (see
.Xr ip 4 ) .
.Pp
If the
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 02b8f73..b866e78 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -452,15 +452,15 @@ _ftp_transfer(int cd, char *oper, char *file,
struct sockaddr_storage sin;
struct sockaddr_in6 *sin6;
struct sockaddr_in *sin4;
- int pasv, high, verbose;
+ int low, pasv, verbose;
int e, sd = -1;
socklen_t l;
char *s;
FILE *df;
/* check flags */
+ low = CHECK_FLAG('l');
pasv = CHECK_FLAG('p');
- high = CHECK_FLAG('h');
verbose = CHECK_FLAG('v');
/* passive mode */
@@ -607,7 +607,7 @@ _ftp_transfer(int cd, char *oper, char *file,
case AF_INET6:
((struct sockaddr_in6 *)&sin)->sin6_port = 0;
#ifdef IPV6_PORTRANGE
- arg = high ? IPV6_PORTRANGE_HIGH : IPV6_PORTRANGE_DEFAULT;
+ arg = low ? IPV6_PORTRANGE_DEFAULT : IPV6_PORTRANGE_HIGH;
if (setsockopt(sd, IPPROTO_IPV6, IPV6_PORTRANGE,
(char *)&arg, sizeof(arg)) == -1)
goto sysouch;
@@ -615,7 +615,7 @@ _ftp_transfer(int cd, char *oper, char *file,
break;
case AF_INET:
((struct sockaddr_in *)&sin)->sin_port = 0;
- arg = high ? IP_PORTRANGE_HIGH : IP_PORTRANGE_DEFAULT;
+ arg = low ? IP_PORTRANGE_DEFAULT : IP_PORTRANGE_HIGH;
if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE,
(char *)&arg, sizeof arg) == -1)
goto sysouch;
OpenPOWER on IntegriCloud