From: Andrew Lunn <andrew@lunn.ch>
To: "Linus Lüssing" <linus.luessing@c0d3.blue>
Cc: Sven Eckelmann <sven@narfation.org>,
b.a.t.m.a.n@lists.open-mesh.org, sashiko-reviews@lists.linux.dev,
marek.lindner@mailbox.org, sw@simonwunderlich.de,
antonio@mandelbit.com
Subject: Re: [batadv,v14 5/5] batman-adv: avoid superfluous DAT DHT_PUT additions to local DAT
Date: Wed, 7 Oct 2026 14:38:42 +0200 [thread overview]
Message-ID: <7d8ffb0b-ae92-4d44-aaa9-affc0dfe7e19@lunn.ch> (raw)
In-Reply-To: <asY38NN2pGa8FICm@sellars>
On Wed, Oct 07, 2026 at 02:15:44PM +0200, Linus Lüssing wrote:
> On Wed, Oct 07, 2026 at 09:24:23AM +0200, Sven Eckelmann wrote:
> > On Wednesday, 7 October 2026 03:08:03 CEST Linus Lüssing wrote:
> > > > - [Medium] batadv: UAPI source compatibility breakage via reserved field rename
> > >
> > > I would have thought that for a field called "reserved" it would
> > > be clear that it'd be subject to change in the future.
> >
> > To play the devils advocate: But programs would still fail when they
> > manually initialize this field to 0.
>
> On the other hand I'm thinking they should have memset() the
> struct to zero in the first place, instead of manually setting a
> reserved field to 0.
There is another general case advantage of memset. I've not looked to
see if it is actually applicable here. It will also clear any padding
bytes, if there are holes in the structure due to alignment. If the
padding bytes have always been zeroed, you can make use of them later.
Also, for kernel to userspace copies, you avoid leaking bits of the
stack to userspace, both in the padding holes, and any fields in the
structure which don't get explicitly set.
memset of a small structure, less than a cache line in length,
probably costs the same as setting a single element. Fetching it into
cache is the expensive part, once in the cache it is nearly free to
use.
Andrew
prev parent reply other threads:[~2026-10-07 12:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 18:50 [batadv,v14 0/5] batman-adv: increase DAT DHT timeout Linus Lüssing
2026-10-06 18:50 ` [batadv,v14 1/5] batman-adv: move local ARP reply code to subfunctions Linus Lüssing
2026-10-06 18:50 ` [batadv,v14 2/5] batman-adv: split DAT cache into DAT cache and DAT DHT Linus Lüssing
2026-10-06 18:50 ` [batadv,v14 3/5] batman-adv: increase DAT DHT timeout Linus Lüssing
2026-10-06 18:50 ` [batadv,v14 4/5] batman-adv: avoid superfluous DAT DHT_PUT if self-candidate Linus Lüssing
2026-10-06 18:50 ` [batadv,v14 5/5] batman-adv: avoid superfluous DAT DHT_PUT additions to local DAT Linus Lüssing
2026-10-07 1:08 ` Linus Lüssing
2026-10-07 7:24 ` Sven Eckelmann
2026-10-07 12:15 ` Linus Lüssing
2026-10-07 12:38 ` Andrew Lunn [this message]
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=7d8ffb0b-ae92-4d44-aaa9-affc0dfe7e19@lunn.ch \
--to=andrew@lunn.ch \
--cc=antonio@mandelbit.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=linus.luessing@c0d3.blue \
--cc=marek.lindner@mailbox.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sven@narfation.org \
--cc=sw@simonwunderlich.de \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox