projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add check for __Static_assert() and asserts on struct sizes
[tinc]
/
src
/
ipv4.h
diff --git
a/src/ipv4.h
b/src/ipv4.h
index
a412c60
..
004f4e5
100644
(file)
--- a/
src/ipv4.h
+++ b/
src/ipv4.h
@@
-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