]> tinc-vpn.org Git - tinc/blobdiff - src/ipv4.h
Add check for __Static_assert() and asserts on struct sizes
[tinc] / src / ipv4.h
index a412c6053d101f14cb91cb4e036cc99a2869cc65..004f4e5d51924d7f8ec2c766be2725949216035f 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