[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-net
Subject:    Re: [CFR] Fix sockstat's handling of closed connections
From:       Andre Oppermann <andre () freebsd ! org>
Date:       2004-08-25 16:21:27
Message-ID: 412CBC87.BFFA18E0 () freebsd ! org
[Download RAW message or body]

Peter Pentchev wrote:
> 
> On Wed, Aug 25, 2004 at 05:48:38PM +0200, Andre Oppermann wrote:
> > Peter Pentchev wrote:
> [snip]
> > > Luckily, the fix is simple, or at least so it seems to me.  It turns out
> > > that those connections have a xt_socket->xso_so set to NULL, and the
> > > false positive comes from sockstat's matching them to a similarly NULL
> > > xf_data members of 'kern.files'.  What do people think about the
> > > following patch?  I could commit it if nobody has any objections, but
> > > being a ports/doc committer, I would need an explicit approval to do
> > > that :)
> >
> > The fix looks good to me.  It seems small enough so I think I can give
> > you the direct go-ahead to commit it.  Could you also put a comment into
> > the sockstat man page describing that TCP connections in TIME_WAIT state
> > can be looked up with netstat?
> 
> Thanks!  I could easily fix the manpage, too, but is TIME_WAIT the only
> state when xt_socket->xso_so is null?  Someone with better knowledge of
> the TCP/IP stack than me needs to either confirm that, or point out
> which of the CLOSED, CLOSE_WAIT, FIN_WAIT_1, CLOSING, and FIN_WAIT_2
> states also have a null xso_so - or is it just TIME_WAIT, because all
> the others still mean that the socket is still somewhat active?

Good question.  Maybe it's easier to phrase it the other way around.
"TCP sockets not in LISTEN, SYN_SENT or ESTABLISHED state can be looked
up with netstat."  These are the ones that certainly have a file descriptor
associated with them and thus show up in sockstat.

-- 
Andre
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic