From: Chris Metcalf Date: Sun, 29 May 2011 10:55:44 +0000 (+0000) Subject: ip_options_compile: properly handle unaligned pointer X-Git-Tag: v3.0-rc2~7^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48bdf072c3f1f8f739f76d19c74f4c79605cac46;p=pandora-kernel.git ip_options_compile: properly handle unaligned pointer The current code takes an unaligned pointer and does htonl() on it to make it big-endian, then does a memcpy(). The problem is that the compiler decides that since the pointer is to a __be32, it is legal to optimize the copy into a processor word store. However, on an architecture that does not handled unaligned writes in kernel space, this produces an unaligned exception fault. The solution is to track the pointer as a "char *" (which removes a bunch of unpleasant casts in any case), and then just use put_unaligned_be32() to write the value to memory. Signed-off-by: Chris Metcalf Signed-off-by: David S. Miller --- Reading git-diff-tree failed