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.
This commit is contained in:
des 2001-03-24 00:28:57 +00:00
parent 18efff07be
commit bfaef3b3b9
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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;