All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Laight <David.Laight@ACULAB.COM>,
	Denis Kirjanov <kirjanov@gmail.com>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Daniel Borkmann <dborkman@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Denis Kirjanov <kda@linux-powerpc.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Markos Chandras <markos.chandras@imgtec.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [PATCH v2 net-next] net: filter: export pkt_type_offset() helper
Date: Thu, 04 Sep 2014 16:33:53 +0200	[thread overview]
Message-ID: <1409841233.23465.22.camel@localhost> (raw)
In-Reply-To: <1409841129.26422.117.camel@edumazet-glaptop2.roam.corp.google.com>

On Do, 2014-09-04 at 07:32 -0700, Eric Dumazet wrote:
> On Thu, 2014-09-04 at 14:23 +0000, David Laight wrote:
> > From: Eric Dumazet
> > > On Thu, 2014-09-04 at 15:40 +0200, Hannes Frederic Sowa wrote:
> > > 
> > > > The type does not matter at all. Actually I wanted to use an empty
> > > > struct but was afraid it might not work on older compilers and didn't
> > > > want to check that with each version.
> > > 
> > > 
> > > It matters. Really.
> > > 
> > > $ cat try.c
> > > #include <stdio.h>
> > > 
> > > struct S_int {
> > > 	char a;
> > > 	int offset[0];
> > > 	char b:1;
> > > };
> > > 
> > > struct S_char {
> > > 	char a;
> > > 	char offset[0];
> > > 	char b:1;
> > > };
> > 
> > Those are also both illegal C, zero sized arrays aren't allowed.
> > 
> > 	David
> 
> 
> This does not matter, we already use such constructs in the kernel.
> 
> Take a look at kmemcheck_bitfield_begin() for example.

Which btw. also uses int, which might change alignment of structures.

  reply	other threads:[~2014-09-04 14:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 21:08 [PATCH v2 net-next] net: filter: export pkt_type_offset() helper Denis Kirjanov
2014-09-03 22:01 ` Daniel Borkmann
2014-09-03 23:14   ` Alexei Starovoitov
2014-09-04  1:08     ` Eric Dumazet
2014-09-04  1:25       ` Hannes Frederic Sowa
2014-09-04  2:05         ` Eric Dumazet
2014-09-04  2:43           ` Alexei Starovoitov
     [not found]             ` <CAHj3AVn8q-JS0Eq0QrfpBo-WfJ+-wXumhNoeDAdkPZC7LSeB5g@mail.gmail.com>
2014-09-04 11:50               ` Hannes Frederic Sowa
2014-09-04 13:09                 ` Eric Dumazet
2014-09-04 13:40                   ` Hannes Frederic Sowa
2014-09-04 14:11                     ` Eric Dumazet
2014-09-04 14:22                       ` Hannes Frederic Sowa
2014-09-04 14:23                       ` David Laight
2014-09-04 14:32                         ` Eric Dumazet
2014-09-04 14:33                           ` Hannes Frederic Sowa [this message]
2014-09-04 14:35                             ` Eric Dumazet
2014-09-04 14:41                               ` Hannes Frederic Sowa
2014-09-04 20:51                                 ` Alexei Starovoitov
2014-09-04 22:45                                   ` Hannes Frederic Sowa
2014-09-12  4:01                                     ` Alexei Starovoitov
     [not found]                                       ` <CAOJe8K2eQ9ejhBTk7MzJJK5EB4D62U4uKDiFFQFh+T16E7=S3A@mail.gmail.com>
2014-09-12  8:25                                         ` Hannes Frederic Sowa

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=1409841233.23465.22.camel@localhost \
    --to=hannes@stressinduktion.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=alexei.starovoitov@gmail.com \
    --cc=dborkman@redhat.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kda@linux-powerpc.org \
    --cc=kirjanov@gmail.com \
    --cc=markos.chandras@imgtec.com \
    --cc=netdev@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.