HomeFreeBSD

unix: Fix locking in uipc_peeraddr()

Description

unix: Fix locking in uipc_peeraddr()

After the locking protocol changed in commit 75a67bf3d00d ("AF_UNIX:
make unix socket locking finer grained"), uipc_peeraddr() was not
updated accordingly.

The link lock now only protects global socket lists. The PCB lock is
used to protect the link between connected PCBs, so use that. Remove an
old comment which appears to be noting that unp_conn is not set for
connected SOCK_DGRAM sockets (in one direction anyway).

Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39855

(cherry picked from commit e8f6e5b2d969fdf7e8f0a9a0a87eede357618fe9)

Details

Provenance
markjAuthored on May 10 2023, 1:18 PM
Reviewer
glebius
Differential Revision
D39855: unix: Fix locking in uipc_peeraddr()
Parents
rG6bb56ad277f5: twe: Add deprecation notice
Branches
Unknown
Tags
Unknown