netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Subject: Re: [nf-next PATCH v2] netfilter: include: uapi: Use C99 flexible array member
Date: Mon, 20 Jul 2020 13:26:53 +0200	[thread overview]
Message-ID: <20200720112653.GV23632@orbyte.nwl.cc> (raw)
In-Reply-To: <0297a19d-2afb-1285-a91c-d32fb9799c33@embeddedor.com>

Hi Gustavo,

On Sun, Jul 19, 2020 at 10:34:01AM -0500, Gustavo A. R. Silva wrote:
> Please, see this:
> 
> https://git.kernel.org/linus/1e6e9d0f4859ec698d55381ea26f4136eff3afe1
> 
> We are refraining from doing flexible-array conversions in UAPI, for now.

Oh, thanks for clarifying. Still, gcc spits out warnings about it when
compiling iptables. I see several options and their downsides:

- Convert iptables' copy of UAPI headers only and maintain the
  divergence in future.

- Compile iptables with -Wno-stringop-overflow, losing the checks in
  valid cases.

Not sure if we may just define that we know how structs in ip_tables.h
and ip6_tables.h are (supposed to) being used and just change it anyway.

BTW: The commit above link points at mentions structs possibly being
embedded as the rationale for keeping things as-is. Yet structs
ipt_entry and ip6t_entry are already embedded into other structs within
the same header file. Seems like gcc is fine with that as long as they
occupy the last field. And that even if they are declared as zero-length
array themselves, which means indexes can't be used to address
individual items.

Cheers, Phil

  reply	other threads:[~2020-07-20 11:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 10:02 [nf-next PATCH v2] netfilter: include: uapi: Use C99 flexible array member Phil Sutter
2020-07-19 15:34 ` Gustavo A. R. Silva
2020-07-20 11:26   ` Phil Sutter [this message]
2020-07-20  3:22 ` kernel test robot
2020-07-20  3:41 ` kernel test robot

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=20200720112653.GV23632@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=gustavo@embeddedor.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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;
as well as URLs for NNTP newsgroup(s).