Skip to contentSkip to conversation

: Define ____cacheline_aligned

PATCH New Patrick McHardy 1 participant 1 message Jan 6, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Define ____cacheline_aligned

____cacheline_aligned is currently undefined, this makes this check in ip_tables.c check_entry_size_and_hooks() fail on 64 bit because newinfo->entries and thus e is only 4-byte aligned:

       if ((unsigned long)e % __alignof__(struct ipt_entry) != 0
           || (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
               duprintf("Bad offset %p\n", e);
               return -EINVAL;
       }

This patch makes it align to 8 byte.

include/kernelenv.h +1 -1
Index: kernelenv/include/kernelenv.h
===================================================================
@@ -103,7 +103,7 @@
 
 #define __init
 #define __inline
-#define ____cacheline_aligned
+#define ____cacheline_aligned __attribute__((aligned(8)))
 
 #include <talloc.h>
 extern void *__vmalloc_ctx;