Page MenuHomeFreeBSD

unix: factor `unp_sun_path()` out of bind and connect
Needs ReviewPublic

Authored by inquire_JohnEricson.me on Sat, Jul 25, 8:21 PM.
Tags
None
Referenced Files
F164766332: D58459.id182707.diff
Mon, Aug 3, 8:13 PM
F164764707: D58459.diff
Mon, Aug 3, 7:47 PM
F164763187: D58459.diff
Mon, Aug 3, 7:21 PM
F164762210: D58459.diff
Mon, Aug 3, 7:03 PM
Unknown Object (File)
Mon, Aug 3, 2:41 AM
Unknown Object (File)
Mon, Aug 3, 1:41 AM
Unknown Object (File)
Sun, Aug 2, 4:19 PM
Unknown Object (File)
Sun, Aug 2, 12:39 PM
Subscribers

Details

Reviewers
markj
kib
Summary

Extract the AF_UNIX validation plus sun_path/length lookup shared by
uipc_bindat(), unp_connect(), and unp_connectat() into a helper that
hands back the path pointer and its length. Each caller keeps its own
empty-path policy and, where needed, its own copy of the path.

Signed-off-by: John Ericson <John.Ericson@Obsidian.Systems>
Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

markj added inline comments.
sys/kern/uipc_usrreq.c
610

FreeBSD style puts parents around all return values.

This revision is now accepted and ready to land.Tue, Jul 28, 10:37 PM

Fix the return statement to match the style guide

This revision now requires review to proceed.Fri, Jul 31, 11:36 PM

OK I update the diff via the web form, which I noticed messes up the diff-to-diff comparison, since the base commit is gone, but hopefully that does not matter when landing this.