[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200219111228.024ac5ae@kicinski-fedora-PC1C0HJN>
Date: Wed, 19 Feb 2020 11:12:28 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Alexander Aring <alex.aring@...il.com>
Cc: David Miller <davem@...emloft.net>, kuznet@....inr.ac.ru,
yoshfuji@...ux-ipv6.org, dav.lebrun@...il.com, mcr@...delman.ca,
stefan@...enfreihafen.org, kai.beckmann@...rm.de,
martin.gergeleit@...rm.de, robert.kaiser@...rm.de,
netdev@...r.kernel.org
Subject: Re: [PACTH net-next 5/5] net: ipv6: add rpl sr tunnel
On Wed, 19 Feb 2020 09:41:37 -0500 Alexander Aring wrote:
> On Mon, Feb 17, 2020 at 09:47:13PM -0800, David Miller wrote:
> > From: Alexander Aring <alex.aring@...il.com>
> > Date: Mon, 17 Feb 2020 17:35:41 -0500
> >
> > > +struct rpl_iptunnel_encap {
> > > + struct ipv6_rpl_sr_hdr srh[0];
> > > +};
> >
> > We're supposed to use '[]' for zero length arrays these days.
>
> When I do that I get with gcc 9.2.1:
>
> linux/net/ipv6/rpl_iptunnel.c:16:25: error: flexible array member in a struct with no named members
> 16 | struct ipv6_rpl_sr_hdr srh[];
>
> This struct is so defined that a simple memcmp() can decide if it's the
> same tunnel or not. We don't have any "named members" _yet_ but possible
> new UAPI can introduce them.
This seems risky, does C even allow empty structures like this?
What's sizeof(struct rpl_iptunnel_encap) going to be? :S
> Can we make an exception here? I can remove it but then I need to
> introduce the same code again when we introduce new fields in UAPI for
> this tunnel.
Powered by blists - more mailing lists