OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] unaligned access in sk_run_filter()
[PATCH] unaligned access in sk_run_filter() [message #2694] Mon, 17 April 2006 11:05 Go to next message
Kirill Korotaev is currently offline  Kirill Korotaev
Messages: 137
Registered: January 2006
Senior Member
[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 <dim@openvz.org>
Signed-Off-By: Kirill Korotaev <dev@openvz.org>


--- ./net/core/filter.c.ve125 2006-04-05 15:11:24.000000000 +0400
+++ ./net/core/filter.c 2006-04-05 15:55:33.000000000 +0400
@@ -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;
Re: [PATCH] unaligned access in sk_run_filter() [message #2733 is a reply to message #2694] Tue, 18 April 2006 21:50 Go to previous message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: Kirill Korotaev <dev@openvz.org>
Date: Mon, 17 Apr 2006 15:12:11 +0400

> [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 <dim@openvz.org>
> Signed-Off-By: Kirill Korotaev <dev@openvz.org>

I've been meaning to add this fix, thanks a lot.
Previous Topic: git.openvz.org now hosts vzctl and vzquota
Next Topic: Re: [RFC] [PATCH 0/7] Some basic vserver infrastructure
Goto Forum:
  


Current Time: Fri Oct 18 04:12:45 GMT 2024

Total time taken to generate the page: 0.05041 seconds