From owner-freebsd-net@FreeBSD.ORG Wed Aug 25 15:57:14 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A37316A4CE for ; Wed, 25 Aug 2004 15:57:14 +0000 (GMT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 7A9C643D48 for ; Wed, 25 Aug 2004 15:57:13 +0000 (GMT) (envelope-from roam@ringlet.net) Received: (qmail 24289 invoked from network); 25 Aug 2004 15:56:19 -0000 Received: from unknown (HELO straylight.m.ringlet.net) (217.75.134.254) by gandalf.online.bg with SMTP; 25 Aug 2004 15:56:19 -0000 Received: (qmail 20927 invoked by uid 1000); 25 Aug 2004 15:57:24 -0000 Date: Wed, 25 Aug 2004 18:57:24 +0300 From: Peter Pentchev To: Andre Oppermann Message-ID: <20040825155723.GK1009@straylight.m.ringlet.net> References: <20040825153247.GI1009@straylight.m.ringlet.net> <412CB4D6.5F33FDD@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VaKJWhUROU/xPxjb" Content-Disposition: inline In-Reply-To: <412CB4D6.5F33FDD@freebsd.org> User-Agent: Mutt/1.5.6i cc: net@FreeBSD.org Subject: Re: [CFR] Fix sockstat's handling of closed connections X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2004 15:57:14 -0000 --VaKJWhUROU/xPxjb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 :) >=20 > 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? G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@cnsys.bg roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence no verb. --VaKJWhUROU/xPxjb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (FreeBSD) iD8DBQFBLLbj7Ri2jRYZRVMRAv32AJwJ3nglFOc0RE6e/URrgECbO36dcgCgmmAu NNG8slNd3vjOecwY8LjvvDU= =yPfh -----END PGP SIGNATURE----- --VaKJWhUROU/xPxjb--