31.08.2021 22:21, Marc-André Lureau wrote:
...

Seems right to me, however there are some notes in libc bits/socket.h
/* Structure large enough to hold any socket address (with the historical
    exception of AF_UNIX).  */

And also this
https://idea.popcount.org/2019-12-06-addressing/#fn:sockaddr_storage 
<https://idea.popcount.org/2019-12-06-addressing/#fn:sockaddr_storage>

I must say I feel confused by those comments :) Is it large enough or not??

It was my first thought too when I first saw the prototype
of this very function we're patching here:

  socket_sockaddr_to_address_unix(struct sockaddr_storage *sa, ...)

it uses sockaddr_storage and I swear I always thought sockaddr_storage
is for sockaddr_in and sockaddr_in6 but NOT for sockaddr_un.

If this is the case we're in trouble actually and all this stuff
needs serious review.

However by fact sockaddr_storage is actually LARGER than sockaddr_un.
I dunno how universal it is.

/mjt

Reply via email to