From owner-freebsd-bugs Sun Jul 21 6: 0:21 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89DD737B405 for ; Sun, 21 Jul 2002 06:00:19 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B31043E64 for ; Sun, 21 Jul 2002 06:00:19 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6LD0JJU056768 for ; Sun, 21 Jul 2002 06:00:19 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6LD0J6F056767; Sun, 21 Jul 2002 06:00:19 -0700 (PDT) Date: Sun, 21 Jul 2002 06:00:19 -0700 (PDT) Message-Id: <200207211300.g6LD0J6F056767@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Yar Tikhiy Subject: Re: bin/36955: Stock ftpd does not reuse ports in passive mode and fails Reply-To: Yar Tikhiy Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/36955; it has been noted by GNATS. From: Yar Tikhiy To: Maxim Konovalov Cc: bug-followup@freebsd.org, Eugene Grosbein Subject: Re: bin/36955: Stock ftpd does not reuse ports in passive mode and fails Date: Sun, 21 Jul 2002 16:59:45 +0400 Setting SO_REUSEADDR on a listening socket is always a good idea. Plese refer to the following URL for a detailed explanation: http://www.kohala.com/start/torek.94dec31.txt BTW, I'd omit casting the "&on" parameter to setsockopt(2) to "char *" since now setsockopt(2) expects "void *" there. In general, all that pointer casting in our ftpd is a real mess. As a matter of fact, a pointer (or 0 as the null pointer) needs to be casted to a certain type only when passing it to a function without a prototype. And casting such a pointer to a wrong type is a really bad thing to do. -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message