Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 2002 16:41:49 -0400
From:      Christopher Weimann <cweimann@k12hq.com>
To:        Ian Dowse <iedowse@maths.tcd.ie>
Cc:        freebsd-questions@freebsd.org
Subject:   FIXED: accept() doesn't pass back sockaddr
Message-ID:  <20021015164149.A97176@mail.k12us.com>
In-Reply-To: <20021014205008.A1893@mail.k12us.com>; from cweimann@k12hq.com on Mon, Oct 14, 2002 at 08:50:08PM -0400
References:  <20021014183158.B54055@mail.k12us.com> <200210150017.aa28289@salmon.maths.tcd.ie> <20021014205008.A1893@mail.k12us.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021015164149.A97176>