]>
git.ipfire.org Git - thirdparty/util-linux.git/commit
lsfd: fill ENDPOINTS column for UNIX one-way sockets
With recvfrom(2) and sendto(2), we can use a UNIX datagram socket at
server side without assigning a peer address with connect(2). Here, I
call such sockets one-way sockets.
# ss -x -p
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
...
u_dgr ESTAB 0 0 /run/systemd/notify 13465 * 0 users:(("systemd",pid=1,fd=227))
u_dgr ESTAB 0 0 * 35438 * 13465 users:(("systemd-journal",pid=1280,fd=15))
u_dgr ESTAB 0 0 * 74792 * 13465 users:(("bluetoothd",pid=13874,fd=4))
...
The orignal code could not fill ENDPOINTS for UNIX one-way sockets:
# ./original-lsfd -Q 'INODE == 13465' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
COMMAND PID TYPE INODE NAME ENDPOINTS
systemd 1 UNIX 13465 state=connected path=/run/systemd/notify type=dgram
With this change, lsfd can fill the column:
# ./new-lsfd -Q 'INODE == 13465' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
COMMAND PID TYPE INODE NAME ENDPOINTS
systemd 1 UNIX 13465 state=connected path=/run/systemd/notify type=dgram 1280,systemd-journal,15rw
13874,bluetoothd,4rw
Signed-off-by: Masatake YAMATO <yamato@redhat.com>