From 1bf6c991885a6986e4f1705f95ef89f0cfa698a2 Mon Sep 17 00:00:00 2001 From: sgunderson Date: Sat, 26 May 2001 20:33:21 +0000 Subject: [PATCH] Fixed a bug, where passive mode FTP would leave a random IP address in the xferlog. Thanks to Thor Bernhardsen for notifying me of this. --- ftpd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ftpd.c b/ftpd.c index 374db96..812a957 100644 --- a/ftpd.c +++ b/ftpd.c @@ -625,8 +625,7 @@ int process_all_sendfiles(fd_set * const active_clients, const int num_ac) { struct ftran *f = NULL, *next = first_ftran->next_ftran; int checked_through = 0; - struct sockaddr tempaddr; - int tempaddr_len = sizeof(tempaddr); + int tempaddr_len = sizeof(struct sockaddr_in); while (next != NULL && checked_through < num_ac) { f = next; @@ -665,8 +664,7 @@ int process_all_sendfiles(fd_set * const active_clients, const int num_ac) if (f->state == 2) { /* incoming PASV */ const unsigned int one = 1; - const int tempsock = accept(f->sock, (struct sockaddr *)&tempaddr, - &tempaddr_len); + const int tempsock = accept(f->sock, &(f->sin), &tempaddr_len); del_fd(f->sock); -- 2.39.2