Enforce assumption

This commit is contained in:
Samuel Thibault 2024-01-17 00:48:14 +01:00
parent deed73f28f
commit 1f1b8d7b99

View file

@ -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;