diff options
Diffstat (limited to 'usr.bin/ftp/fetch.c')
-rw-r--r-- | usr.bin/ftp/fetch.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 2f2450e..a675886 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$Id: fetch.c,v 1.4 1997/12/16 08:22:35 ache Exp $"); +__RCSID("$Id: fetch.c,v 1.5 1997/12/16 08:58:15 ache Exp $"); __RCSID_SOURCE("$NetBSD: fetch.c,v 1.16.2.1 1997/11/18 01:00:22 mellon Exp $"); #endif /* not lint */ @@ -223,6 +223,12 @@ url_get(origline, proxyenv) goto cleanup_url_get; } + if (dobind && bind(s, (struct sockaddr *)&bindto, + sizeof(bindto)) == -1) { + warn("Can't bind to %s", inet_ntoa(bindto.sin_addr)); + goto cleanup_url_get; + } + if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) == -1) { warn("Can't connect to %s", host); goto cleanup_url_get; |