HomeFreeBSD

sockstat(1): print out full connection graph for unix(4) sockets

Description

sockstat(1): print out full connection graph for unix(4) sockets

Kernel provides us with enough information to display all possible
connections between UNIX sockets.

o Store unp_conn, xu_firstref and xu_nextref in the faddr of a UNIX sock.
o Build tree of file descriptors, indexed by the socket pointer.
o In displaysock() print out all possible information:

  1. if socket is bound, print name of this socket
  2. if socket has connected to a peer with a name, print peers name
  3. if socket has connected to a peer without a name, print [pid fd]
  4. if a bound socket has received connections, print list of them as [pid fd] Previously, only 1) either 2) were printed.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35726

Details

Provenance
glebiusAuthored on Jul 7 2022, 5:19 AM
Reviewer
tuexen
Differential Revision
D35726: sockstat(1): print out full connection graph for unix(4) sockets
Parents
rGc5bdcd1f10a8: sockstat(1): widen the FD printing format
Branches
Unknown
Tags
Unknown