From da2b8f936185e0224e0c4f78e724c45c7a52b194 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 24 Dec 2011 17:03:41 +0100 Subject: src: export NFCT_HELPER_NAME_MAX NFCT_HELPER_NAME_MAX is 16, which is the maximum helper name allowed since 2.6.29. Signed-off-by: Pablo Neira Ayuso --- include/internal/object.h | 10 ++++------ include/libnetfilter_conntrack/libnetfilter_conntrack.h | 5 +++++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/internal/object.h b/include/internal/object.h index 19d77b4..880f7c1 100644 --- a/include/internal/object.h +++ b/include/internal/object.h @@ -6,6 +6,8 @@ #ifndef _NFCT_OBJECT_H_ #define _NFCT_OBJECT_H_ +#include + /* * nfct callback handler object */ @@ -161,11 +163,7 @@ struct nf_conntrack { u_int32_t id; u_int16_t zone; -/* xt_helper uses a length size of 30 bytes, however, no helper name in - * the tree has exceeded 16 bytes length. Since 2.6.29, the maximum - * length accepted is 16 bytes, this limit is enforced during module load. */ -#define __NFCT_HELPER_NAMELEN 16 - char helper_name[__NFCT_HELPER_NAMELEN]; + char helper_name[NFCT_HELPER_NAME_MAX]; /* According to Eric Paris this field can be up to 4096 * bytes long. For that reason, we allocate this dynamically. */ char *secctx; @@ -269,7 +267,7 @@ struct nf_expect { u_int32_t id; u_int16_t zone; u_int32_t flags; - char helper_name[__NFCT_HELPER_NAMELEN]; + char helper_name[NFCT_HELPER_NAME_MAX]; u_int32_t set[1]; }; diff --git a/include/libnetfilter_conntrack/libnetfilter_conntrack.h b/include/libnetfilter_conntrack/libnetfilter_conntrack.h index 09e7920..f5add1a 100644 --- a/include/libnetfilter_conntrack/libnetfilter_conntrack.h +++ b/include/libnetfilter_conntrack/libnetfilter_conntrack.h @@ -716,6 +716,11 @@ enum ip_conntrack_status { #define NFCT_DIR_REPLY 1 #define NFCT_DIR_MAX NFCT_DIR_REPLY+1 +/* xt_helper uses a length size of 30 bytes, however, no helper name in + * the tree has exceeded 16 bytes length. Since 2.6.29, the maximum + * length accepted is 16 bytes, this limit is enforced during module load. */ +#define NFCT_HELPER_NAME_MAX 16 + #ifdef __cplusplus } #endif -- cgit v1.2.3