From 430a8557d4421f41fbf834909f7598cfc64e3311 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 15 Sep 2012 03:52:08 +0200 Subject: Improve data alignment Ensure that the actual packet data is always aligned to a multiple of 8. --- src/fastd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index f68ea08..12702e7 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -349,6 +349,8 @@ static inline void fastd_string_stack_free(fastd_string_stack *str) { } } +#define ALIGN8(l) (((l+7)/8)*8) + static inline bool timespec_after(const struct timespec *tp1, const struct timespec *tp2) { return (tp1->tv_sec > tp2->tv_sec || (tp1->tv_sec == tp2->tv_sec && tp1->tv_nsec > tp2->tv_nsec)); -- cgit v1.2.3