diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-03-17 21:22:32 -0400 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-03-18 09:20:07 -0400 |
commit | be91fd5e323b46450ca82f6828e933e3791fb2f2 (patch) | |
tree | 1a664fb7887e8a0d7f1507780d3533e669e1c3a3 /net/ipv4 | |
parent | 85bc3f38147c5d3fb1eb9ca2236536389b592cae (diff) |
netfilter: xtables: replace custom duprintf with pr_debug
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ipt_ah.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/net/ipv4/netfilter/ipt_ah.c b/net/ipv4/netfilter/ipt_ah.c index 0104c0b399de..4f27e170c630 100644 --- a/net/ipv4/netfilter/ipt_ah.c +++ b/net/ipv4/netfilter/ipt_ah.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | |
9 | #include <linux/in.h> | 9 | #include <linux/in.h> |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/skbuff.h> | 11 | #include <linux/skbuff.h> |
@@ -18,21 +18,15 @@ MODULE_LICENSE("GPL"); | |||
18 | MODULE_AUTHOR("Yon Uriarte <yon@astaro.de>"); | 18 | MODULE_AUTHOR("Yon Uriarte <yon@astaro.de>"); |
19 | MODULE_DESCRIPTION("Xtables: IPv4 IPsec-AH SPI match"); | 19 | MODULE_DESCRIPTION("Xtables: IPv4 IPsec-AH SPI match"); |
20 | 20 | ||
21 | #ifdef DEBUG_CONNTRACK | ||
22 | #define duprintf(format, args...) printk(format , ## args) | ||
23 | #else | ||
24 | #define duprintf(format, args...) | ||
25 | #endif | ||
26 | |||
27 | /* Returns 1 if the spi is matched by the range, 0 otherwise */ | 21 | /* Returns 1 if the spi is matched by the range, 0 otherwise */ |
28 | static inline bool | 22 | static inline bool |
29 | spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert) | 23 | spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert) |
30 | { | 24 | { |
31 | bool r; | 25 | bool r; |
32 | duprintf("ah spi_match:%c 0x%x <= 0x%x <= 0x%x",invert? '!':' ', | 26 | pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n", |
33 | min,spi,max); | 27 | invert ? '!' : ' ', min, spi, max); |
34 | r=(spi >= min && spi <= max) ^ invert; | 28 | r=(spi >= min && spi <= max) ^ invert; |
35 | duprintf(" result %s\n",r? "PASS" : "FAILED"); | 29 | pr_debug(" result %s\n", r ? "PASS" : "FAILED"); |
36 | return r; | 30 | return r; |
37 | } | 31 | } |
38 | 32 | ||
@@ -51,7 +45,7 @@ static bool ah_mt(const struct sk_buff *skb, const struct xt_match_param *par) | |||
51 | /* We've been asked to examine this packet, and we | 45 | /* We've been asked to examine this packet, and we |
52 | * can't. Hence, no choice but to drop. | 46 | * can't. Hence, no choice but to drop. |
53 | */ | 47 | */ |
54 | duprintf("Dropping evil AH tinygram.\n"); | 48 | pr_debug("Dropping evil AH tinygram.\n"); |
55 | *par->hotdrop = true; | 49 | *par->hotdrop = true; |
56 | return 0; | 50 | return 0; |
57 | } | 51 | } |
@@ -67,7 +61,7 @@ static bool ah_mt_check(const struct xt_mtchk_param *par) | |||
67 | 61 | ||
68 | /* Must specify no unknown invflags */ | 62 | /* Must specify no unknown invflags */ |
69 | if (ahinfo->invflags & ~IPT_AH_INV_MASK) { | 63 | if (ahinfo->invflags & ~IPT_AH_INV_MASK) { |
70 | duprintf("ipt_ah: unknown flags %X\n", ahinfo->invflags); | 64 | pr_debug("unknown flags %X\n", ahinfo->invflags); |
71 | return false; | 65 | return false; |
72 | } | 66 | } |
73 | return true; | 67 | return true; |