From: Ben Hutchings <redacted>
Date: Thu, 5 Apr 2012 20:21:08 +0100
On Wed, 2012-04-04 at 20:17 -0400, David Miller wrote:
quoted
From: Arvid Brodin <redacted>
Date: Thu, 5 Apr 2012 01:09:48 +0200
quoted
- icmp_param.data.icmph = *icmp_hdr(skb);
+ memcpy(&icmp_param.data.icmph, icmp_hdr(skb),
+ sizeof(icmp_param.data.icmph));
GCC can and will optimize this into an inline assignment, and thus
have the same unaligned access problems, because it determines
alignment based upon the types involved.
So presumably icmp_hdr() should be changed to skb_transport_header().
I would not say so. Otherwise we introduce ugly casts everywhere.