Make netstat(1) more closely follow documented behaviour. If a TCP

socket in LISTEN state happens to be bound to an interface, it will
show up in netstat(1) output even without the -a switch.

As the definition of "sockets used by server processes" is a
difficult one to qualify with regards to UDP, do not change the
output behaviour for UDP sockets.

PR:		bin/26359
This commit is contained in:
Bruce M Simpson 2004-06-16 07:00:50 +00:00
parent 6c81463f56
commit 2b286ced87
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130572

View File

@ -186,7 +186,8 @@ protopr(u_long proto, /* for sysctl version we pass proto # */
continue;
if (!aflag &&
(
(af1 == AF_INET &&
(istcp && tp->t_state == TCPS_LISTEN)
|| (af1 == AF_INET &&
inet_lnaof(inp->inp_laddr) == INADDR_ANY)
#ifdef INET6
|| (af1 == AF_INET6 &&