Date: Sat, 14 Jan 2012 00:10:15 GMT From: Jilles Tjoelker <jilles@stack.nl> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/164081: sockstat not reporting all open sockets Message-ID: <201201140010.q0E0AFsU089085@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/164081; it has been noted by GNATS. From: Jilles Tjoelker <jilles@stack.nl> To: bug-followup@FreeBSD.org, pirzyk@FreeBSD.org Cc: Subject: Re: bin/164081: sockstat not reporting all open sockets Date: Sat, 14 Jan 2012 01:03:34 +0100 > [netstat reports sockets that sockstat does not] The sockstat utility checks all file descriptors open by all processes looking for sockets, while netstat shows all kernel-level sockets. This may mismatch in many ways: a process may have closed its descriptor but TCP still needs to maintain some state like TIME_WAIT (as mentioned in the sockstat(1) man page), multiple descriptors may exist for a single socket and kernel code (like nlockmgr) may use the socket(9) API directly so there is no descriptor. However, any socket file descriptor shown by sockstat must correspond to a kernel-level socket shown by netstat. This does appear to be intended, although it is surprising and not documented very well. -- Jilles Tjoelker
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201140010.q0E0AFsU089085>