Page MenuHomeFreeBSD

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

Authored by inquire_JohnEricson.me on Jul 25 2026, 8:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 14, 5:57 PM
Unknown Object (File)
Mon, Sep 14, 2:09 PM
Unknown Object (File)
Sun, Sep 13, 12:39 AM
Unknown Object (File)
Fri, Sep 11, 3:39 AM
Unknown Object (File)
Thu, Sep 10, 9:34 PM
Unknown Object (File)
Mon, Sep 7, 10:19 PM
Unknown Object (File)
Mon, Sep 7, 7:05 PM
Unknown Object (File)
Mon, Sep 7, 3:01 PM
Subscribers

Details

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 Not Applicable
Unit
Tests Not Applicable

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.Jul 28 2026, 10:37 PM

Fix the return statement to match the style guide

This revision now requires review to proceed.Jul 31 2026, 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.

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.

It doesn't matter for landing.

For what it's worth I find it much easier to upload patches from the command-line, e.g. with git-arc: https://wiki.freebsd.org/Phabricator#Create_a_Revision_via_command_line_.28using_git-arc.29

This revision is now accepted and ready to land.Aug 4 2026, 8:57 PM

For what it's worth I find it much easier to upload patches from the command-line, e.g. with git-arc: https://wiki.freebsd.org/Phabricator#Create_a_Revision_via_command_line_.28using_git-arc.29

OK cool I'll check that out! I do have Arcanist installed locally (I was just on a different computer when I did that small revision) but there is definitely room for improvement. I'll give you wrapper a shot.