A bug with getsockopt(SOL_LOCAL, LOCAL_PEERCRED) ?

Gleb Popov arrowd at freebsd.org
Thu Apr 15 18:59:06 UTC 2021


Hello hackers.

I'm using getsockopt(SOL_LOCAL, LOCAL_PEERCRED) on a unix socket and for
some reason it fails for me. I came up with a minimal reproduction
testcase: https://arrowd.name/un.cpp

Steps to reproduce:
1. c++ un.cpp
2. ./a.out
3. nc -U foobar

This results in

getsockopt
failed with
Socket is not connected

Am I missing something?


More information about the freebsd-hackers mailing list