netfilter: Use LOGLEVEL_<FOO> defines
authorJoe Perches <joe@perches.com>
Mon, 23 Mar 2015 18:50:10 +0000 (11:50 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 25 Mar 2015 11:09:39 +0000 (12:09 +0100)
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: Joe Perches <joe@perches.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_log_arp.c
net/ipv4/netfilter/nf_log_ipv4.c
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/nf_log_ipv6.c
net/netfilter/nf_tables_core.c
net/netfilter/nft_log.c

index d059182c1466fabbc689d0c49715bc441b9c0f72..e7ad950cf9ef9a7f7b4e92ac146e1f92f6c20c19 100644 (file)
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
@@ -27,7 +29,7 @@ static struct nf_loginfo default_loginfo = {
        .type   = NF_LOG_TYPE_LOG,
        .u = {
                .log = {
-                       .level    = 5,
+                       .level    = LOGLEVEL_NOTICE,
                        .logflags = NF_LOG_MASK,
                },
        },
index 75101980eeee197a4f8413bbd7d29f4fd9e4bb74..076aadda04737eb7fa829adc14eb98ea37867655 100644 (file)
@@ -5,8 +5,10 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
@@ -26,7 +28,7 @@ static struct nf_loginfo default_loginfo = {
        .type   = NF_LOG_TYPE_LOG,
        .u = {
                .log = {
-                       .level    = 5,
+                       .level    = LOGLEVEL_NOTICE,
                        .logflags = NF_LOG_MASK,
                },
        },
index bb00c6f2a8855fb72dcc6a1bc5b496e8216d683f..83f59dc3cccc141a7a64261f27795630379c09a1 100644 (file)
@@ -9,7 +9,10 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/kernel.h>
 #include <linux/capability.h>
 #include <linux/in.h>
 #include <linux/skbuff.h>
@@ -234,7 +237,7 @@ static struct nf_loginfo trace_loginfo = {
        .type = NF_LOG_TYPE_LOG,
        .u = {
                .log = {
-                       .level = 4,
+                       .level = LOGLEVEL_WARNING,
                        .logflags = NF_LOG_MASK,
                },
        },
index ddf07e6f59d7de70bcf41ba84880b2c699296db7..8dd869642f45a032fcd0c1303319313392244a13 100644 (file)
@@ -5,8 +5,10 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
@@ -27,7 +29,7 @@ static struct nf_loginfo default_loginfo = {
        .type   = NF_LOG_TYPE_LOG,
        .u = {
                .log = {
-                       .level    = 5,
+                       .level    = LOGLEVEL_NOTICE,
                        .logflags = NF_LOG_MASK,
                },
        },
index 4c921a302cfd411bd299902112f8550668c40c33..763a9d87296d6da58ae9e351090e56e8cb12866a 100644 (file)
@@ -8,6 +8,7 @@
  * Development of this code funded by Astaro AG (http://www.astaro.com/)
  */
 
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/list.h>
@@ -37,7 +38,7 @@ static struct nf_loginfo trace_loginfo = {
        .type = NF_LOG_TYPE_LOG,
        .u = {
                .log = {
-                       .level = 4,
+                       .level = LOGLEVEL_WARNING,
                        .logflags = NF_LOG_MASK,
                },
        },
index bde05f28cf14782b3b9f11905fbed37ea8644b95..e18af9db2f04ec0a58d4ed563af13f7d253b8f0a 100644 (file)
@@ -78,7 +78,7 @@ static int nft_log_init(const struct nft_ctx *ctx,
                        li->u.log.level =
                                ntohl(nla_get_be32(tb[NFTA_LOG_LEVEL]));
                } else {
-                       li->u.log.level = 4;
+                       li->u.log.level = LOGLEVEL_WARNING;
                }
                if (tb[NFTA_LOG_FLAGS] != NULL) {
                        li->u.log.logflags =