diff options
author | nsayer <nsayer@FreeBSD.org> | 1999-03-30 22:06:08 +0000 |
---|---|---|
committer | nsayer <nsayer@FreeBSD.org> | 1999-03-30 22:06:08 +0000 |
commit | dd799f02088c9c7d57bcf030d7552122d34b8229 (patch) | |
tree | 624ecbdcf459f14cb21cec8f9ddd475c6ef52955 /lib/libftpio | |
parent | 0270d8ac188b3df8c8d41045d198125712c62b7d (diff) | |
download | FreeBSD-src-dd799f02088c9c7d57bcf030d7552122d34b8229.zip FreeBSD-src-dd799f02088c9c7d57bcf030d7552122d34b8229.tar.gz |
Cause PORT commands to use the high IP port range. This makes fetch
(and its friends) more firewall friendly.
PR: 10580
Submitted by: nsayer
Diffstat (limited to 'lib/libftpio')
-rw-r--r-- | lib/libftpio/ftpio.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index 23cc5d2..6a1d7ab 100644 --- a/lib/libftpio/ftpio.c +++ b/lib/libftpio/ftpio.c @@ -14,7 +14,7 @@ * Turned inside out. Now returns xfers as new file ids, not as a special * `state' of FTP_t * - * $Id: ftpio.c,v 1.29 1997/12/20 04:06:05 jb Exp $ + * $Id: ftpio.c,v 1.30 1998/04/11 07:28:53 phk Exp $ * */ @@ -809,7 +809,16 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t *fp = fdopen(s, mode); } else { - int fd; + int fd,portrange; + +#ifdef IP_PORTRANGE + portrange = IP_PORTRANGE_HIGH; + if (setsockopt(s, IPPROTO_IP, IP_PORTRANGE, (char *) + &portrange, sizeof(portrange)) < 0) { + close(s); + return FAILURE; + }; +#endif i = sizeof sin; getsockname(ftp->fd_ctrl, (struct sockaddr *)&sin, &i); |