From c75fc6b4c761bfee3401bbf480cf6c3e8fb400a9 Mon Sep 17 00:00:00 2001 From: rusty Date: Thu, 27 Apr 2000 10:28:06 +0000 Subject: Alignment fixes (requires kernel patch). --- include/libiptc/libiptc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/libiptc') diff --git a/include/libiptc/libiptc.h b/include/libiptc/libiptc.h index 9058cff..fa0a4ea 100644 --- a/include/libiptc/libiptc.h +++ b/include/libiptc/libiptc.h @@ -6,9 +6,13 @@ #include #ifndef IPT_MIN_ALIGN -#define IPT_MIN_ALIGN (__alignof__(struct ipt_entry_match)) +/* ipt_entry has pointers and u_int64_t's in it, so if you align to + it, you'll also align to any crazy matches and targets someone + might write */ +#define IPT_MIN_ALIGN (__alignof__(struct ipt_entry)) #endif -#define IPT_ALIGN(s) (((s) + (IPT_MIN_ALIGN-1)) & ~(IPT_MIN_ALIGN-1)) + +#define IPT_ALIGN(s) (((s) + ((IPT_MIN_ALIGN)-1)) & ~((IPT_MIN_ALIGN)-1)) typedef char ipt_chainlabel[32]; -- cgit v1.2.3