diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index c6f008cf9177..9136420e301e 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2001 +.Dd August 25, 2004 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -121,6 +121,21 @@ if the endpoint could not be determined. The address the foreign end of the socket is bound to (see .Xr getpeername 2 ) . .El +.Pp +Note that TCP sockets in the +.Dv AF_INET +or +.Dv AF_INET6 +domains that are not in one of the +.Dv LISTEN , +.Dv SYN_SENT , +or +.Dv ESTABLISHED +states may not be shown by +.Nm ; +use +.Xr netstat 1 +to examine them instead. .Sh SEE ALSO .Xr fstat 1 , .Xr netstat 1 , diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index eaeb24291e74..acb918241e45 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -494,6 +494,8 @@ display(void) "LOCAL ADDRESS", "FOREIGN ADDRESS"); setpassent(1); for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { + if (xf->xf_data == NULL) + continue; hash = (int)((uintptr_t)xf->xf_data % HASHSIZE); for (s = sockhash[hash]; s != NULL; s = s->next) if ((void *)s->socket == xf->xf_data)