From owner-freebsd-questions Tue Oct 15 13:41:56 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5259D37B401 for ; Tue, 15 Oct 2002 13:41:55 -0700 (PDT) Received: from mail.k12us.com (mail.k12us.com [65.112.222.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 6E58343EAA for ; Tue, 15 Oct 2002 13:41:54 -0700 (PDT) (envelope-from cweimann@k12hq.com) Received: (qmail 10920 invoked by uid 1001); 15 Oct 2002 20:41:49 -0000 Date: Tue, 15 Oct 2002 16:41:49 -0400 From: Christopher Weimann To: Ian Dowse Cc: freebsd-questions@freebsd.org Subject: FIXED: accept() doesn't pass back sockaddr Message-ID: <20021015164149.A97176@mail.k12us.com> References: <20021014183158.B54055@mail.k12us.com> <200210150017.aa28289@salmon.maths.tcd.ie> <20021014205008.A1893@mail.k12us.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021014205008.A1893@mail.k12us.com>; from cweimann@k12hq.com on Mon, Oct 14, 2002 at 08:50:08PM -0400 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon 10/14/2002-08:50:08PM -0400, Christopher Weimann wrote: > > On Tue 10/15/2002-12:17:49AM +0100, Ian Dowse wrote: > > > > Is the code in question correctly initialising the variable that > > the `addrlen' parameter points to before calling accept? It looks > > as if this might be the problem in the PR you mention. I mean that > > the code should look like > > > > sin_len = sizeof(sin); > > s = accept(servsock, (struct sockaddr *)&sin, &sin_len); > > > > where `sin_len' is reset to the correct length before calling > > accept() each time. I think sin_len may be reset to 0 when an error > > occurs, but otherwise you would get away with not resetting it. > > > > I think you have it. I checked and the code in question has the > same problem as the PR code, sin_len is not being reset to the proper > value before each call to accept(). I will put this change in and > sometime tommorow ( once the box gets some traffic ) I will know if > this has fixed it. I'm betting it will. > This is definately fixed now. It has been running all day with no problems. Thanks again Ian. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message