unaligned access in sk_run_filter()
Subsystems (3)
PATCH 1/1 unaligned access in sk_run_filter()
[PATCH] unaligned access in sk_run_filter()
This patch fixes unaligned access warnings noticed on IA64 in sk_run_filter(). 'ptr' can be unaligned.
Signed-off-by Dmitry Mishin <[email protected]>
Signed-off-by Kirill Korotaev <[email protected]>
net/core/filter.c renamed from net/core/filter.c.ve125 +3 -2
@@ -34,6 +34,7 @@#include <linux/timer.h> #include <asm/system.h> #include <asm/uaccess.h> +#include <asm/unaligned.h> #include <linux/filter.h> /* No hurry in this branch */
@@ -177,7 +178,7 @@ unsigned int sk_run_filter(struct sk_buf load_w: ptr =load_pointer (skb, k,4 , &tmp);if (ptr !=NULL ) { -A =ntohl (*(u32 *)ptr); +A =ntohl (get_unaligned ((u32 *)ptr));continue ; }break ;
@@ -186,7 +187,7 @@ load_w: load_h: ptr =load_pointer (skb, k,2 , &tmp);if (ptr !=NULL ) { -A =ntohs (*(u16 *)ptr); +A =ntohs (get_unaligned ((u16 *)ptr));continue ; }break ;
David S. Miller
maintainerFrom: Kirill Korotaev <[email protected]>
Date: Mon, 17 Apr 2006 15:12:11 +0400
Quoted 7 lines
[PATCH] unaligned access in
sk_run_filter()This patch fixes unaligned access warnings noticed on IA64 in
sk_run_filter(). 'ptr' can be unaligned.Signed-off-by Dmitry Mishin <[email protected]>Signed-off-by Kirill Korotaev <[email protected]>
I've been meaning to add this fix, thanks a lot.