[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1409796348.26422.76.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 03 Sep 2014 19:05:48 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
Daniel Borkmann <dborkman@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Denis Kirjanov <kda@...ux-powerpc.org>, netdev@...r.kernel.org,
Markos Chandras <markos.chandras@...tec.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH v2 net-next] net: filter: export pkt_type_offset() helper
On Thu, 2014-09-04 at 03:25 +0200, Hannes Frederic Sowa wrote:
> Can't we add an address marker to struct sk_buff?
>
> Several possibilities are available:
>
> ptrdiff_t pkt_type_offset[0] before the pkt_type flags field
>
> If one wants to make it more expressive:
> typedef struct {} mark_struct_offset;
> and add
> mark_struct_offset pkt_type_offset;
> at appropriate places
>
> Or maybe an anonymous union?
>
> pkt_type_offset would become a simple offsetof(struct sk_buff,
> pkt_type_offset) then and there is no need for BUG_ON then.
You can try, and make sure this works on all gcc compilers, even the one
Andrew Morton uses.
And of course, you need to not introduce holes doing so.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists