Add check for __Static_assert() and asserts on struct sizes
[tinc] / src / ipv4.h
index a412c60..004f4e5 100644 (file)
@@ -86,6 +86,8 @@ struct ip {
 };
 #endif
 
+STATIC_ASSERT(sizeof(struct ip) == 20, "ip has incorrect size");
+
 #ifndef IP_OFFMASK
 #define IP_OFFMASK 0x1fff
 #endif
@@ -148,4 +150,6 @@ struct icmp {
 };
 #endif
 
+STATIC_ASSERT(sizeof(struct icmp) == 28, "icmp has incorrect size");
+
 #endif