From 1f1b8d7b9965f34110a84279f6b3dfdee8b54a61 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 17 Jan 2024 00:48:14 +0100 Subject: [PATCH] Enforce assumption --- cluster.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cluster.c b/cluster.c index 12f1794..e31e234 100644 --- a/cluster.c +++ b/cluster.c @@ -48,6 +48,10 @@ int forked = 0; // Sanity check: CLI must not diddle with heartbeat table #define MAX_HEART_SIZE (8192) // Maximum size of heartbeat packet. Must be less than max IP packet size :) #define MAX_CHANGES (MAX_HEART_SIZE/(sizeof(sessiont) + sizeof(int) ) - 2) // Assumes a session is the biggest type! +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112 +_Static_assert(sizeof(sessiont) >= sizeof(tunnelt)); +_Static_assert(sizeof(sessiont) >= sizeof(bundlet)); +#endif static struct { int type;