Commit a81b2ce8 authored by Joe Perches's avatar Joe Perches Committed by Pablo Neira Ayuso

netfilter: Use LOGLEVEL_<FOO> defines

Use the #defines where appropriate.

Miscellanea:

Add explicit #include <linux/kernel.h> where it was not
previously used so that these #defines are a bit more
explicitly defined instead of indirectly included via:
	module.h->moduleparam.h->kernel.h
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 5ebb335d
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -27,7 +29,7 @@ static struct nf_loginfo default_loginfo = { ...@@ -27,7 +29,7 @@ static struct nf_loginfo default_loginfo = {
.type = NF_LOG_TYPE_LOG, .type = NF_LOG_TYPE_LOG,
.u = { .u = {
.log = { .log = {
.level = 5, .level = LOGLEVEL_NOTICE,
.logflags = NF_LOG_MASK, .logflags = NF_LOG_MASK,
}, },
}, },
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -26,7 +28,7 @@ static struct nf_loginfo default_loginfo = { ...@@ -26,7 +28,7 @@ static struct nf_loginfo default_loginfo = {
.type = NF_LOG_TYPE_LOG, .type = NF_LOG_TYPE_LOG,
.u = { .u = {
.log = { .log = {
.level = 5, .level = LOGLEVEL_NOTICE,
.logflags = NF_LOG_MASK, .logflags = NF_LOG_MASK,
}, },
}, },
......
...@@ -9,7 +9,10 @@ ...@@ -9,7 +9,10 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/capability.h> #include <linux/capability.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -234,7 +237,7 @@ static struct nf_loginfo trace_loginfo = { ...@@ -234,7 +237,7 @@ static struct nf_loginfo trace_loginfo = {
.type = NF_LOG_TYPE_LOG, .type = NF_LOG_TYPE_LOG,
.u = { .u = {
.log = { .log = {
.level = 4, .level = LOGLEVEL_WARNING,
.logflags = NF_LOG_MASK, .logflags = NF_LOG_MASK,
}, },
}, },
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -27,7 +29,7 @@ static struct nf_loginfo default_loginfo = { ...@@ -27,7 +29,7 @@ static struct nf_loginfo default_loginfo = {
.type = NF_LOG_TYPE_LOG, .type = NF_LOG_TYPE_LOG,
.u = { .u = {
.log = { .log = {
.level = 5, .level = LOGLEVEL_NOTICE,
.logflags = NF_LOG_MASK, .logflags = NF_LOG_MASK,
}, },
}, },
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* Development of this code funded by Astaro AG (http://www.astaro.com/) * Development of this code funded by Astaro AG (http://www.astaro.com/)
*/ */
#include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/list.h> #include <linux/list.h>
...@@ -37,7 +38,7 @@ static struct nf_loginfo trace_loginfo = { ...@@ -37,7 +38,7 @@ static struct nf_loginfo trace_loginfo = {
.type = NF_LOG_TYPE_LOG, .type = NF_LOG_TYPE_LOG,
.u = { .u = {
.log = { .log = {
.level = 4, .level = LOGLEVEL_WARNING,
.logflags = NF_LOG_MASK, .logflags = NF_LOG_MASK,
}, },
}, },
......
...@@ -78,7 +78,7 @@ static int nft_log_init(const struct nft_ctx *ctx, ...@@ -78,7 +78,7 @@ static int nft_log_init(const struct nft_ctx *ctx,
li->u.log.level = li->u.log.level =
ntohl(nla_get_be32(tb[NFTA_LOG_LEVEL])); ntohl(nla_get_be32(tb[NFTA_LOG_LEVEL]));
} else { } else {
li->u.log.level = 4; li->u.log.level = LOGLEVEL_WARNING;
} }
if (tb[NFTA_LOG_FLAGS] != NULL) { if (tb[NFTA_LOG_FLAGS] != NULL) {
li->u.log.logflags = li->u.log.logflags =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment