mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: [musl] CMSG_LEN macro
Date: Sun, 5 Sep 2021 19:27:45 +0200	[thread overview]
Message-ID: <20210905172745.GD3090@voyager> (raw)
In-Reply-To: <20210903131212.GE13220@brightrain.aerifal.cx>

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

  reply	other threads:[~2021-09-05 17:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 10:13 J. Hanne
2021-09-03 13:12 ` Rich Felker
2021-09-05 17:27   ` Markus Wichmann [this message]
2021-10-03  8:14     ` J. Hanne
2021-10-03 13:35       ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210905172745.GD3090@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).