diff options
author | des <des@FreeBSD.org> | 2006-06-13 10:21:03 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2006-06-13 10:21:03 +0000 |
commit | eb329791f14a835cb5d092bd42774b503b5e7b9a (patch) | |
tree | ebab5114f4220af79e9542ce02762340da78e380 /lib | |
parent | a5357a7c3fd7ec5710e8ba2a0a47e2c57916f368 (diff) | |
download | FreeBSD-src-eb329791f14a835cb5d092bd42774b503b5e7b9a.zip FreeBSD-src-eb329791f14a835cb5d092bd42774b503b5e7b9a.tar.gz |
Respect FETCH_BIND_ADDRESS when opening the data connection.
PR: misc/98872
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libfetch/ftp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 6116593..92c51ed 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -596,6 +596,7 @@ _ftp_transfer(conn_t *conn, const char *oper, const char *file, struct sockaddr_storage sa; struct sockaddr_in6 *sin6; struct sockaddr_in *sin4; + const char *bindaddr; const char *filename; int filenamelen, type; int low, pasv, verbose; @@ -740,6 +741,10 @@ _ftp_transfer(conn_t *conn, const char *oper, const char *file, /* connect to data port */ if (verbose) _fetch_info("opening data connection"); + bindaddr = getenv("FETCH_BIND_ADDRESS"); + if (bindaddr != NULL && *bindaddr != '\0' && + _fetch_bind(sd, sa.ss_family, bindaddr) != 0) + goto sysouch; if (connect(sd, (struct sockaddr *)&sa, sa.ss_len) == -1) goto sysouch; |