[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1382991074.3779.22.camel@bwh-desktop.uk.level5networks.com>
Date: Mon, 28 Oct 2013 20:11:14 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: David Miller <davem@...emloft.net>
CC: <atzm@...atosphere.co.jp>, <netdev@...r.kernel.org>,
<stephen@...workplumber.org>
Subject: Re: [PATCH RESEND] packet: Deliver VLAN TPID to userspace
On Fri, 2013-10-25 at 18:59 -0400, David Miller wrote:
> From: Atzm Watanabe <atzm@...atosphere.co.jp>
> Date: Tue, 22 Oct 2013 17:39:40 +0900
>
> > struct tpacket_hdr_variant1 {
> > __u32 tp_rxhash;
> > __u32 tp_vlan_tci;
> > + __u32 tp_vlan_tpid;
> > };
> >
>
> You cannot do this, the header length is not variable.
Well it is variable to an extent. This is used as a member of the final
anonymous union member of struct tpacket3_hdr, and the latter is
specified to be tail-padded to a multiple of 16 bytes
(TPACKET_ALIGNMENT). Since its current size is 36 bytes, I think it can
safely grow by 12 bytes, so long as userland doesn't depend on
getsockopt(..., PACKET_HDRLEN, ...) returning only specific values.
Possibly there should be a separate struct tpacket_hdr_variant2 which
includes the extra member. Possibly there should also be a status flag
to indicate that this member is present.
> This patch has been submitted several times, each of which you
> have been shown ways in which your changes break userspace in
> one way or another.
I think we established that struct tpacket3_hdr can't grow arbitrarily,
but not that it can't grow at all.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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