diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-08 01:39:38 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 01:18:20 -0400 |
commit | 0d53778e81ac7af266dac8a20cc328328c327112 (patch) | |
tree | 034226154ea7c3466a31ef2d57b5a600d4a106e6 /net/ipv6/netfilter/ip6t_frag.c | |
parent | 342b7e3c8a3c84252799c4ac4d9a604b8903d2b4 (diff) |
[NETFILTER]: Convert DEBUGP to pr_debug
Convert DEBUGP to pr_debug and fix lots of non-compiling debug statements.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/netfilter/ip6t_frag.c')
-rw-r--r-- | net/ipv6/netfilter/ip6t_frag.c | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/net/ipv6/netfilter/ip6t_frag.c b/net/ipv6/netfilter/ip6t_frag.c index bb1cfa82b47..968aeba0207 100644 --- a/net/ipv6/netfilter/ip6t_frag.c +++ b/net/ipv6/netfilter/ip6t_frag.c | |||
@@ -22,21 +22,15 @@ MODULE_LICENSE("GPL"); | |||
22 | MODULE_DESCRIPTION("IPv6 FRAG match"); | 22 | MODULE_DESCRIPTION("IPv6 FRAG match"); |
23 | MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); | 23 | MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); |
24 | 24 | ||
25 | #if 0 | ||
26 | #define DEBUGP printk | ||
27 | #else | ||
28 | #define DEBUGP(format, args...) | ||
29 | #endif | ||
30 | |||
31 | /* Returns 1 if the id is matched by the range, 0 otherwise */ | 25 | /* Returns 1 if the id is matched by the range, 0 otherwise */ |
32 | static inline bool | 26 | static inline bool |
33 | id_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert) | 27 | id_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert) |
34 | { | 28 | { |
35 | bool r; | 29 | bool r; |
36 | DEBUGP("frag id_match:%c 0x%x <= 0x%x <= 0x%x", invert ? '!' : ' ', | 30 | pr_debug("frag id_match:%c 0x%x <= 0x%x <= 0x%x", invert ? '!' : ' ', |
37 | min, id, max); | 31 | min, id, max); |
38 | r = (id >= min && id <= max) ^ invert; | 32 | r = (id >= min && id <= max) ^ invert; |
39 | DEBUGP(" result %s\n", r ? "PASS" : "FAILED"); | 33 | pr_debug(" result %s\n", r ? "PASS" : "FAILED"); |
40 | return r; | 34 | return r; |
41 | } | 35 | } |
42 | 36 | ||
@@ -69,37 +63,37 @@ match(const struct sk_buff *skb, | |||
69 | return false; | 63 | return false; |
70 | } | 64 | } |
71 | 65 | ||
72 | DEBUGP("INFO %04X ", fh->frag_off); | 66 | pr_debug("INFO %04X ", fh->frag_off); |
73 | DEBUGP("OFFSET %04X ", ntohs(fh->frag_off) & ~0x7); | 67 | pr_debug("OFFSET %04X ", ntohs(fh->frag_off) & ~0x7); |
74 | DEBUGP("RES %02X %04X", fh->reserved, ntohs(fh->frag_off) & 0x6); | 68 | pr_debug("RES %02X %04X", fh->reserved, ntohs(fh->frag_off) & 0x6); |
75 | DEBUGP("MF %04X ", fh->frag_off & htons(IP6_MF)); | 69 | pr_debug("MF %04X ", fh->frag_off & htons(IP6_MF)); |
76 | DEBUGP("ID %u %08X\n", ntohl(fh->identification), | 70 | pr_debug("ID %u %08X\n", ntohl(fh->identification), |
77 | ntohl(fh->identification)); | 71 | ntohl(fh->identification)); |
78 | 72 | ||
79 | DEBUGP("IPv6 FRAG id %02X ", | 73 | pr_debug("IPv6 FRAG id %02X ", |
80 | id_match(fraginfo->ids[0], fraginfo->ids[1], | 74 | id_match(fraginfo->ids[0], fraginfo->ids[1], |
81 | ntohl(fh->identification), | 75 | ntohl(fh->identification), |
82 | !!(fraginfo->invflags & IP6T_FRAG_INV_IDS))); | 76 | !!(fraginfo->invflags & IP6T_FRAG_INV_IDS))); |
83 | DEBUGP("res %02X %02X%04X %02X ", | 77 | pr_debug("res %02X %02X%04X %02X ", |
84 | fraginfo->flags & IP6T_FRAG_RES, fh->reserved, | 78 | fraginfo->flags & IP6T_FRAG_RES, fh->reserved, |
85 | ntohs(fh->frag_off) & 0x6, | 79 | ntohs(fh->frag_off) & 0x6, |
86 | !((fraginfo->flags & IP6T_FRAG_RES) | 80 | !((fraginfo->flags & IP6T_FRAG_RES) |
87 | && (fh->reserved || (ntohs(fh->frag_off) & 0x06)))); | 81 | && (fh->reserved || (ntohs(fh->frag_off) & 0x06)))); |
88 | DEBUGP("first %02X %02X %02X ", | 82 | pr_debug("first %02X %02X %02X ", |
89 | fraginfo->flags & IP6T_FRAG_FST, | 83 | fraginfo->flags & IP6T_FRAG_FST, |
90 | ntohs(fh->frag_off) & ~0x7, | 84 | ntohs(fh->frag_off) & ~0x7, |
91 | !((fraginfo->flags & IP6T_FRAG_FST) | 85 | !((fraginfo->flags & IP6T_FRAG_FST) |
92 | && (ntohs(fh->frag_off) & ~0x7))); | 86 | && (ntohs(fh->frag_off) & ~0x7))); |
93 | DEBUGP("mf %02X %02X %02X ", | 87 | pr_debug("mf %02X %02X %02X ", |
94 | fraginfo->flags & IP6T_FRAG_MF, | 88 | fraginfo->flags & IP6T_FRAG_MF, |
95 | ntohs(fh->frag_off) & IP6_MF, | 89 | ntohs(fh->frag_off) & IP6_MF, |
96 | !((fraginfo->flags & IP6T_FRAG_MF) | 90 | !((fraginfo->flags & IP6T_FRAG_MF) |
97 | && !((ntohs(fh->frag_off) & IP6_MF)))); | 91 | && !((ntohs(fh->frag_off) & IP6_MF)))); |
98 | DEBUGP("last %02X %02X %02X\n", | 92 | pr_debug("last %02X %02X %02X\n", |
99 | fraginfo->flags & IP6T_FRAG_NMF, | 93 | fraginfo->flags & IP6T_FRAG_NMF, |
100 | ntohs(fh->frag_off) & IP6_MF, | 94 | ntohs(fh->frag_off) & IP6_MF, |
101 | !((fraginfo->flags & IP6T_FRAG_NMF) | 95 | !((fraginfo->flags & IP6T_FRAG_NMF) |
102 | && (ntohs(fh->frag_off) & IP6_MF))); | 96 | && (ntohs(fh->frag_off) & IP6_MF))); |
103 | 97 | ||
104 | return (fh != NULL) | 98 | return (fh != NULL) |
105 | && | 99 | && |
@@ -131,7 +125,7 @@ checkentry(const char *tablename, | |||
131 | const struct ip6t_frag *fraginfo = matchinfo; | 125 | const struct ip6t_frag *fraginfo = matchinfo; |
132 | 126 | ||
133 | if (fraginfo->invflags & ~IP6T_FRAG_INV_MASK) { | 127 | if (fraginfo->invflags & ~IP6T_FRAG_INV_MASK) { |
134 | DEBUGP("ip6t_frag: unknown flags %X\n", fraginfo->invflags); | 128 | pr_debug("ip6t_frag: unknown flags %X\n", fraginfo->invflags); |
135 | return false; | 129 | return false; |
136 | } | 130 | } |
137 | return true; | 131 | return true; |