Commit 40daafc8 authored by Dmitry Mishin's avatar Dmitry Mishin Committed by David S. Miller

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: default avatarDmitry Mishin <dim@openvz.org>
Signed-off-By: default avatarKirill Korotaev <dev@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b809739a
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/unaligned.h>
#include <linux/filter.h> #include <linux/filter.h>
/* No hurry in this branch */ /* No hurry in this branch */
...@@ -177,7 +178,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int ...@@ -177,7 +178,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
load_w: load_w:
ptr = load_pointer(skb, k, 4, &tmp); ptr = load_pointer(skb, k, 4, &tmp);
if (ptr != NULL) { if (ptr != NULL) {
A = ntohl(*(u32 *)ptr); A = ntohl(get_unaligned((u32 *)ptr));
continue; continue;
} }
break; break;
...@@ -186,7 +187,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int ...@@ -186,7 +187,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
load_h: load_h:
ptr = load_pointer(skb, k, 2, &tmp); ptr = load_pointer(skb, k, 2, &tmp);
if (ptr != NULL) { if (ptr != NULL) {
A = ntohs(*(u16 *)ptr); A = ntohs(get_unaligned((u16 *)ptr));
continue; continue;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment