summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-09-15 03:52:08 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-09-15 03:52:08 +0200
commit430a8557d4421f41fbf834909f7598cfc64e3311 (patch)
treeda2fa7c3e1ac3e9d41626c873f5549b07b1414b4 /src/fastd.h
parent3b67cdb32fd2b8272a50f803f92311bcc556b7ba (diff)
downloadfastd-430a8557d4421f41fbf834909f7598cfc64e3311.tar
fastd-430a8557d4421f41fbf834909f7598cfc64e3311.zip
Improve data alignment
Ensure that the actual packet data is always aligned to a multiple of 8.
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h2
1 files changed, 2 insertions, 0 deletions
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));