summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-08 23:58:31 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-08 23:58:31 +0100
commit1f5834262c91d835414b538857b67e058a1c1dac (patch)
tree2c399462a8d2f8e4a454a2d11fe50483b6f6f33a /include
parent63c3ae0f664ea7045446c4117646f767a5ccd647 (diff)
downloadconntrack-tools-1f5834262c91d835414b538857b67e058a1c1dac.tar.gz
conntrack-tools-1f5834262c91d835414b538857b67e058a1c1dac.zip
parse: strict attribute size checking
This patch adds strict attribute size checking. This is good to detect corrupted or malformed messages. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/network.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/network.h b/include/network.h
index 96a0185..9098e5c 100644
--- a/include/network.h
+++ b/include/network.h
@@ -161,6 +161,8 @@ struct netattr {
x->nta_attr = ntohs(x->nta_attr); \
})
+#define NTA_SIZE(len) NTA_ALIGN(sizeof(struct netattr)) + len
+
#define NTA_DATA(x) \
(void *)(((char *)x) + NTA_ALIGN(sizeof(struct netattr)))