On Mon, Oct 07, 2024 at 05:35:37PM +0100, Daniel P. Berrangé wrote:
> See 'man 7 unix':
> 
> [quote]
>    At  least  one  byte  of real data should be sent when
>    sending ancillary data.  On Linux, this is required to
>    successfully send ancillary data over  a  UNIX  domain
>    stream  socket.   When  sending  ancillary data over a
>    UNIX domain datagram socket, it is  not  necessary  on
>    Linux  to  send  any accompanying real data.  However,
>    portable applications should also include at least one
>    byte of real data when sending ancillary data  over  a
>    datagram socket.
> [/quote]
> 
> So if your protocol doesn't already have a convenient bit of real data to
> attach the SCM_RIGHTS data to, it is common practice to send a single dummy
> data byte that is discarded.

Ah OK, thanks.  Then maybe we can still consider dropping the initial four
bytes for fd migrations; I left the other comment in the next patch.

-- 
Peter Xu


Reply via email to