]> git.sesse.net Git - betaftpd/blobdiff - ftpd.c
Fixed a bug, where passive mode FTP would leave a random IP address in the xferlog...
[betaftpd] / ftpd.c
diff --git a/ftpd.c b/ftpd.c
index 374db9691ba4900cda937a2c21fc84bf6547b5f9..812a95756005e766458d1abcacc665088a441b4c 100644 (file)
--- 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);