Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210905172745.GD3090@voyager>
Date: Sun, 5 Sep 2021 19:27:45 +0200
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: CMSG_LEN macro

On Fri, Sep 03, 2021 at 09:12:13AM -0400, Rich Felker wrote:
> Anyone else have thoughts on this?
>
> Rich

I noticed something similar about the NLMSG_* macros that allow for
padding where there can be none (in the interface). struct nlmsghdr has
alignment of 4, and the netlink message alignment is also 4, and that
can never be changed on any existing arch since it would break binary
compatibility.  And for netlink, it is unlikely they would add
architecture specific alignment in future, given that today it is
arch-independent.

I guess those are symptoms of overly general software design. The macros
must exist, but I concur with your conclusion that they can be
implemented without reference to CMSG_ALIGN.

BTW, I just checked the implementation of the NLMSG_* macros in musl,
and they do assume the alignment of struct nlmsghdr. So for consistency,
we should probably do the same for the CMSG_* macros.

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.