[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Feb 2016 14:41:23 +0100
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Alexander Duyck <alexander.duyck@...il.com>,
Sowmini Varadhan <sowmini.varadhan@...cle.com>
Cc: Tom Herbert <tom@...bertland.com>,
David Miller <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>, Kernel Team <kernel-team@...com>
Subject: Re: [PATCH net] net: Allow flow dissector to handle non 4-byte
aligned headers
On 02.02.2016 04:56, Alexander Duyck wrote:
>> @@ -394,7 +407,7 @@ ip_proto_again:
>> data, hlen, &_eth);
>> if (!eth)
>> goto out_bad;
>> - proto = eth->h_proto;
>> + proto = get_unaligned_be16(ð->h_proto);
>> nhoff += sizeof(*eth);
>> }
>
> This piece doesn't make any sense to me. It is already only 2 bytes
> wide. I'm not sure why we should be seeing this trigger an unaligned
> access. Are you sure it wasn't something like the keyid causing the
> issue? I'd be interested in seeing what the compiler did here that it
> is triggering the problem.
>
Correct, and the __packed attribute of struct ethhdr already causes all
members to have an assumed-alignment of '1', so gcc doesn't create any
16 bit width accesses anyway.
Bye,
Hannes
Powered by blists - more mailing lists