[erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes

Raimo Niskanen raimo+erlang-questions@REDACTED
Tue May 2 13:33:45 CEST 2017

On Tue, May 02, 2017 at 09:44:35AM +1200, Richard A. O'Keefe wrote:
> > On 29/04/2017, at 12:28 AM, Raimo Niskanen <raimo+erlang-questions@REDACTED> wrote:
> > 
> > It is difficult to reliably detect the other direction i.e in the driver
> > when you get an address from e.g getsockname(); is it an empty string or an
> > abstract address?
> Surely an empty string would never have been legal,
> so if the first byte is NUL and the host supports abstract
> addresses, it must be an abstract address?

If the first byte is NUL and the length is larger than 0 then it must be an
abstract address.  But when this comes from above (from Erlang) and since
we do not know if the host supports abstract addresses; if we give
the kernel a first byte NUL but address length longer than SUN_LEN(su),
will then we cause harm on some OS?

I will assume not and rewrite the code, soonish...

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list