From 0f31d8258e7ead5bd3944080e6cec7d4074149e7 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 12 May 2019 20:52:43 +0200 Subject: src: use definitions in include/linux/netfilter/nf_tables.h Use NFT_LOGLEVEL_* definitions in UAPI. Make an internal definition of NFT_OSF_F_VERSION, this was originally defined in the UAPI header in the initial patch version, however, this is not available anymore. Add a bison rule to deal with the timeout case. Otherwise, compilation breaks. Fixes: d3869cae9d62 ("include: refresh nf_tables.h cached copy") Signed-off-by: Pablo Neira Ayuso --- src/statement.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/statement.c') diff --git a/src/statement.c b/src/statement.c index 7f9c10b3..a9e8b3ae 100644 --- a/src/statement.c +++ b/src/statement.c @@ -256,21 +256,21 @@ struct stmt *objref_stmt_alloc(const struct location *loc) return stmt; } -static const char *syslog_level[LOGLEVEL_AUDIT + 1] = { - [LOG_EMERG] = "emerg", - [LOG_ALERT] = "alert", - [LOG_CRIT] = "crit", - [LOG_ERR] = "err", - [LOG_WARNING] = "warn", - [LOG_NOTICE] = "notice", - [LOG_INFO] = "info", - [LOG_DEBUG] = "debug", - [LOGLEVEL_AUDIT] = "audit" +static const char *syslog_level[NFT_LOGLEVEL_MAX + 1] = { + [NFT_LOGLEVEL_EMERG] = "emerg", + [NFT_LOGLEVEL_ALERT] = "alert", + [NFT_LOGLEVEL_CRIT] = "crit", + [NFT_LOGLEVEL_ERR] = "err", + [NFT_LOGLEVEL_WARNING] = "warn", + [NFT_LOGLEVEL_NOTICE] = "notice", + [NFT_LOGLEVEL_INFO] = "info", + [NFT_LOGLEVEL_DEBUG] = "debug", + [NFT_LOGLEVEL_AUDIT] = "audit" }; const char *log_level(uint32_t level) { - if (level > LOGLEVEL_AUDIT) + if (level > NFT_LOGLEVEL_MAX) return "unknown"; return syslog_level[level]; @@ -280,7 +280,7 @@ int log_level_parse(const char *level) { int i; - for (i = 0; i <= LOGLEVEL_AUDIT; i++) { + for (i = 0; i <= NFT_LOGLEVEL_MAX; i++) { if (syslog_level[i] && !strcmp(level, syslog_level[i])) return i; -- cgit v1.2.3