diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c index 303f2d7a5..3508ecf74 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c @@ -281,7 +281,7 @@ socket_t ftpEstablishDataConnection(int passive, ip_t *ip, port_t *port, int ses myAddr.sin_port = htons(ftpGetPassivePort() + sessionId); int val = 1; - setsockopt(theServer, SOL_SOCKET, SO_REUSEADDR, (char *)&val, sizeof(val)); + setsockopt(dataSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&val, sizeof(val)); if(bind(dataSocket, (struct sockaddr *)&myAddr, sizeof(myAddr))) {