File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ typedef struct WOLFSSHD_CONNECTION {
102102 WOLFSSH_CTX * ctx ;
103103 WOLFSSHD_AUTH * auth ;
104104 int fd ;
105+ int listenFd ;
105106 char ip [INET_ADDRSTRLEN ];
106107} WOLFSSHD_CONNECTION ;
107108
@@ -812,12 +813,14 @@ static int NewConnection(WOLFSSHD_CONNECTION* conn)
812813 if (ret == WS_SUCCESS ) {
813814 if (pd == 0 ) {
814815 /* child process */
816+ WCLOSESOCKET (conn -> listenFd );
815817 signal (SIGINT , SIG_DFL );
816818 (void )HandleConnection ((void * )conn );
817819 exit (0 );
818820 }
819821 else {
820822 wolfSSH_Log (WS_LOG_INFO , "[SSHD] Spawned new process %d\n" , pd );
823+ WCLOSESOCKET (conn -> fd );
821824 }
822825 }
823826
@@ -1049,6 +1052,7 @@ int main(int argc, char** argv)
10491052 socklen_t clientAddrSz = sizeof (clientAddr );
10501053 #endif
10511054 conn .auth = auth ;
1055+ conn .listenFd = listenFd ;
10521056
10531057 /* wait for a connection */
10541058 if (PendingConnection (listenFd )) {
You can’t perform that action at this time.
0 commit comments