Re: git: cfb1e92912b4 - main - sockets: don't malloc/free sockaddr memory on accept(2)

From: Gleb Smirnoff <glebius_at_freebsd.org>
Date: Thu, 30 Nov 2023 17:01:02 UTC
On Thu, Nov 30, 2023 at 10:56:23AM -0600, Mike Karels wrote:
M> On 30 Nov 2023, at 10:34, Gleb Smirnoff wrote:
M> 
M> > The branch main has been updated by glebius:
M> >
M> > URL: https://cgit.FreeBSD.org/src/commit/?id=cfb1e92912b4cf75360b7fbe86197cc29bc212c1
M> >
M> > commit cfb1e92912b4cf75360b7fbe86197cc29bc212c1
M> > Author:     Gleb Smirnoff <glebius@FreeBSD.org>
M> > AuthorDate: 2023-11-30 16:30:55 +0000
M> > Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
M> > CommitDate: 2023-11-30 16:30:55 +0000
M> >
M> >     sockets: don't malloc/free sockaddr memory on accept(2)
M> >
M> >     Let the accept functions provide stack memory for protocols to fill it in.
M> >     Generic code should provide sockaddr_storage, specialized code may provide
M> >     smaller structure.
M> 
M> Does this mean that families cannot support sockaddrs bigger than sockaddr_storage?
M> In particular, does local domain (aka unix domain)?  Did it before?

Yes, but I assume sockaddr_storage should cover anything:

(kgdb) p sizeof(struct sockaddr_un)
$1 = 106
(kgdb) p sizeof(struct sockaddr_storage)
$2 = 128

Please correct me if I'm wrong.

-- 
Gleb Smirnoff