From 7b3858d675615535476ff068d7853afacdd1de55 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Sat, 9 Feb 2008 17:34:00 +0000 Subject: From: Eric Leblond Some macros were defined several time. This was the case of GET_VALUE, pp_is_valid. This patch puts the definition in ulogd.h and fixes the definition of pp_is_valid which was wrong (causing segfault by acessing to fields at NULL). --- include/ulogd/ulogd.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/ulogd/ulogd.h b/include/ulogd/ulogd.h index 1bd0b6c..b1d0996 100644 --- a/include/ulogd/ulogd.h +++ b/include/ulogd/ulogd.h @@ -216,6 +216,11 @@ void __ulogd_log(int level, char *file, int line, const char *message, ...); #define IS_NEEDED(x) (x.flags & ULOGD_RETF_NEEDED) #define SET_NEEDED(x) (x.flags |= ULOGD_RETF_NEEDED) +#define GET_VALUE(res, x) (res[x].u.source->u.value) +#define GET_FLAGS(res, x) (res[x].u.source->flags) +#define pp_is_valid(res, x) \ + (res[x].u.source && (GET_FLAGS(res, x) & ULOGD_RETF_VALID)) + int ulogd_key_size(struct ulogd_key *key); int ulogd_wildcard_inputkeys(struct ulogd_pluginstance *upi); -- cgit v1.2.3