diff options
author | Jan Engelhardt <jengelh@gmx.de> | 2007-07-08 01:16:00 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 01:16:58 -0400 |
commit | ccb79bdce71f2c04cfa9bfcbaf4d37e2f963d684 (patch) | |
tree | 5f41d7d1daade309b96492301a6f973caba3a2a4 /net/ipv6 | |
parent | 1d93a9cbad608f6398ba6c5b588c504ccd35a2ca (diff) |
[NETFILTER]: x_tables: switch xt_match->checkentry to bool
Switch the return type of match functions to boolean
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 14 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_ah.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_frag.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_hbh.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_ipv6header.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_mh.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_owner.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_rt.c | 8 |
8 files changed, 27 insertions, 27 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 31f42e82184a..7fe4d29708cb 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -188,20 +188,20 @@ ip6_packet_match(const struct sk_buff *skb, | |||
188 | } | 188 | } |
189 | 189 | ||
190 | /* should be ip6 safe */ | 190 | /* should be ip6 safe */ |
191 | static inline int | 191 | static inline bool |
192 | ip6_checkentry(const struct ip6t_ip6 *ipv6) | 192 | ip6_checkentry(const struct ip6t_ip6 *ipv6) |
193 | { | 193 | { |
194 | if (ipv6->flags & ~IP6T_F_MASK) { | 194 | if (ipv6->flags & ~IP6T_F_MASK) { |
195 | duprintf("Unknown flag bits set: %08X\n", | 195 | duprintf("Unknown flag bits set: %08X\n", |
196 | ipv6->flags & ~IP6T_F_MASK); | 196 | ipv6->flags & ~IP6T_F_MASK); |
197 | return 0; | 197 | return false; |
198 | } | 198 | } |
199 | if (ipv6->invflags & ~IP6T_INV_MASK) { | 199 | if (ipv6->invflags & ~IP6T_INV_MASK) { |
200 | duprintf("Unknown invflag bits set: %08X\n", | 200 | duprintf("Unknown invflag bits set: %08X\n", |
201 | ipv6->invflags & ~IP6T_INV_MASK); | 201 | ipv6->invflags & ~IP6T_INV_MASK); |
202 | return 0; | 202 | return false; |
203 | } | 203 | } |
204 | return 1; | 204 | return true; |
205 | } | 205 | } |
206 | 206 | ||
207 | static unsigned int | 207 | static unsigned int |
@@ -1282,10 +1282,10 @@ void ip6t_unregister_table(struct xt_table *table) | |||
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | /* Returns 1 if the type and code is matched by the range, 0 otherwise */ | 1284 | /* Returns 1 if the type and code is matched by the range, 0 otherwise */ |
1285 | static inline int | 1285 | static inline bool |
1286 | icmp6_type_code_match(u_int8_t test_type, u_int8_t min_code, u_int8_t max_code, | 1286 | icmp6_type_code_match(u_int8_t test_type, u_int8_t min_code, u_int8_t max_code, |
1287 | u_int8_t type, u_int8_t code, | 1287 | u_int8_t type, u_int8_t code, |
1288 | int invert) | 1288 | bool invert) |
1289 | { | 1289 | { |
1290 | return (type == test_type && code >= min_code && code <= max_code) | 1290 | return (type == test_type && code >= min_code && code <= max_code) |
1291 | ^ invert; | 1291 | ^ invert; |
@@ -1325,7 +1325,7 @@ icmp6_match(const struct sk_buff *skb, | |||
1325 | } | 1325 | } |
1326 | 1326 | ||
1327 | /* Called when user tries to insert an entry of this type. */ | 1327 | /* Called when user tries to insert an entry of this type. */ |
1328 | static int | 1328 | static bool |
1329 | icmp6_checkentry(const char *tablename, | 1329 | icmp6_checkentry(const char *tablename, |
1330 | const void *entry, | 1330 | const void *entry, |
1331 | const struct xt_match *match, | 1331 | const struct xt_match *match, |
diff --git a/net/ipv6/netfilter/ip6t_ah.c b/net/ipv6/netfilter/ip6t_ah.c index 607c2eb1296f..8fc00bdfc38b 100644 --- a/net/ipv6/netfilter/ip6t_ah.c +++ b/net/ipv6/netfilter/ip6t_ah.c | |||
@@ -103,7 +103,7 @@ match(const struct sk_buff *skb, | |||
103 | } | 103 | } |
104 | 104 | ||
105 | /* Called when user tries to insert an entry of this type. */ | 105 | /* Called when user tries to insert an entry of this type. */ |
106 | static int | 106 | static bool |
107 | checkentry(const char *tablename, | 107 | checkentry(const char *tablename, |
108 | const void *entry, | 108 | const void *entry, |
109 | const struct xt_match *match, | 109 | const struct xt_match *match, |
@@ -114,9 +114,9 @@ checkentry(const char *tablename, | |||
114 | 114 | ||
115 | if (ahinfo->invflags & ~IP6T_AH_INV_MASK) { | 115 | if (ahinfo->invflags & ~IP6T_AH_INV_MASK) { |
116 | DEBUGP("ip6t_ah: unknown flags %X\n", ahinfo->invflags); | 116 | DEBUGP("ip6t_ah: unknown flags %X\n", ahinfo->invflags); |
117 | return 0; | 117 | return false; |
118 | } | 118 | } |
119 | return 1; | 119 | return true; |
120 | } | 120 | } |
121 | 121 | ||
122 | static struct xt_match ah_match = { | 122 | static struct xt_match ah_match = { |
diff --git a/net/ipv6/netfilter/ip6t_frag.c b/net/ipv6/netfilter/ip6t_frag.c index 0ed5fbcf1f18..f0aed898e8b7 100644 --- a/net/ipv6/netfilter/ip6t_frag.c +++ b/net/ipv6/netfilter/ip6t_frag.c | |||
@@ -120,7 +120,7 @@ match(const struct sk_buff *skb, | |||
120 | } | 120 | } |
121 | 121 | ||
122 | /* Called when user tries to insert an entry of this type. */ | 122 | /* Called when user tries to insert an entry of this type. */ |
123 | static int | 123 | static bool |
124 | checkentry(const char *tablename, | 124 | checkentry(const char *tablename, |
125 | const void *ip, | 125 | const void *ip, |
126 | const struct xt_match *match, | 126 | const struct xt_match *match, |
@@ -131,9 +131,9 @@ checkentry(const char *tablename, | |||
131 | 131 | ||
132 | if (fraginfo->invflags & ~IP6T_FRAG_INV_MASK) { | 132 | if (fraginfo->invflags & ~IP6T_FRAG_INV_MASK) { |
133 | DEBUGP("ip6t_frag: unknown flags %X\n", fraginfo->invflags); | 133 | DEBUGP("ip6t_frag: unknown flags %X\n", fraginfo->invflags); |
134 | return 0; | 134 | return false; |
135 | } | 135 | } |
136 | return 1; | 136 | return true; |
137 | } | 137 | } |
138 | 138 | ||
139 | static struct xt_match frag_match = { | 139 | static struct xt_match frag_match = { |
diff --git a/net/ipv6/netfilter/ip6t_hbh.c b/net/ipv6/netfilter/ip6t_hbh.c index 4b05393faa68..6fdd79785f32 100644 --- a/net/ipv6/netfilter/ip6t_hbh.c +++ b/net/ipv6/netfilter/ip6t_hbh.c | |||
@@ -174,7 +174,7 @@ match(const struct sk_buff *skb, | |||
174 | } | 174 | } |
175 | 175 | ||
176 | /* Called when user tries to insert an entry of this type. */ | 176 | /* Called when user tries to insert an entry of this type. */ |
177 | static int | 177 | static bool |
178 | checkentry(const char *tablename, | 178 | checkentry(const char *tablename, |
179 | const void *entry, | 179 | const void *entry, |
180 | const struct xt_match *match, | 180 | const struct xt_match *match, |
@@ -185,9 +185,9 @@ checkentry(const char *tablename, | |||
185 | 185 | ||
186 | if (optsinfo->invflags & ~IP6T_OPTS_INV_MASK) { | 186 | if (optsinfo->invflags & ~IP6T_OPTS_INV_MASK) { |
187 | DEBUGP("ip6t_opts: unknown flags %X\n", optsinfo->invflags); | 187 | DEBUGP("ip6t_opts: unknown flags %X\n", optsinfo->invflags); |
188 | return 0; | 188 | return false; |
189 | } | 189 | } |
190 | return 1; | 190 | return true; |
191 | } | 191 | } |
192 | 192 | ||
193 | static struct xt_match opts_match[] = { | 193 | static struct xt_match opts_match[] = { |
diff --git a/net/ipv6/netfilter/ip6t_ipv6header.c b/net/ipv6/netfilter/ip6t_ipv6header.c index 3222e8959426..5ba6ef0f1b1b 100644 --- a/net/ipv6/netfilter/ip6t_ipv6header.c +++ b/net/ipv6/netfilter/ip6t_ipv6header.c | |||
@@ -124,7 +124,7 @@ ipv6header_match(const struct sk_buff *skb, | |||
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
127 | static int | 127 | static bool |
128 | ipv6header_checkentry(const char *tablename, | 128 | ipv6header_checkentry(const char *tablename, |
129 | const void *ip, | 129 | const void *ip, |
130 | const struct xt_match *match, | 130 | const struct xt_match *match, |
@@ -136,9 +136,9 @@ ipv6header_checkentry(const char *tablename, | |||
136 | /* invflags is 0 or 0xff in hard mode */ | 136 | /* invflags is 0 or 0xff in hard mode */ |
137 | if ((!info->modeflag) && info->invflags != 0x00 && | 137 | if ((!info->modeflag) && info->invflags != 0x00 && |
138 | info->invflags != 0xFF) | 138 | info->invflags != 0xFF) |
139 | return 0; | 139 | return false; |
140 | 140 | ||
141 | return 1; | 141 | return true; |
142 | } | 142 | } |
143 | 143 | ||
144 | static struct xt_match ip6t_ipv6header_match = { | 144 | static struct xt_match ip6t_ipv6header_match = { |
diff --git a/net/ipv6/netfilter/ip6t_mh.c b/net/ipv6/netfilter/ip6t_mh.c index ddffe03a8b37..a3008b41d24b 100644 --- a/net/ipv6/netfilter/ip6t_mh.c +++ b/net/ipv6/netfilter/ip6t_mh.c | |||
@@ -75,7 +75,7 @@ match(const struct sk_buff *skb, | |||
75 | } | 75 | } |
76 | 76 | ||
77 | /* Called when user tries to insert an entry of this type. */ | 77 | /* Called when user tries to insert an entry of this type. */ |
78 | static int | 78 | static bool |
79 | mh_checkentry(const char *tablename, | 79 | mh_checkentry(const char *tablename, |
80 | const void *entry, | 80 | const void *entry, |
81 | const struct xt_match *match, | 81 | const struct xt_match *match, |
diff --git a/net/ipv6/netfilter/ip6t_owner.c b/net/ipv6/netfilter/ip6t_owner.c index cadd0a64fed7..8cb6c94b4a20 100644 --- a/net/ipv6/netfilter/ip6t_owner.c +++ b/net/ipv6/netfilter/ip6t_owner.c | |||
@@ -53,7 +53,7 @@ match(const struct sk_buff *skb, | |||
53 | return true; | 53 | return true; |
54 | } | 54 | } |
55 | 55 | ||
56 | static int | 56 | static bool |
57 | checkentry(const char *tablename, | 57 | checkentry(const char *tablename, |
58 | const void *ip, | 58 | const void *ip, |
59 | const struct xt_match *match, | 59 | const struct xt_match *match, |
@@ -65,9 +65,9 @@ checkentry(const char *tablename, | |||
65 | if (info->match & (IP6T_OWNER_PID | IP6T_OWNER_SID)) { | 65 | if (info->match & (IP6T_OWNER_PID | IP6T_OWNER_SID)) { |
66 | printk("ipt_owner: pid and sid matching " | 66 | printk("ipt_owner: pid and sid matching " |
67 | "not supported anymore\n"); | 67 | "not supported anymore\n"); |
68 | return 0; | 68 | return false; |
69 | } | 69 | } |
70 | return 1; | 70 | return true; |
71 | } | 71 | } |
72 | 72 | ||
73 | static struct xt_match owner_match = { | 73 | static struct xt_match owner_match = { |
diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c index 7966f4a5e9b7..e991ed4a692e 100644 --- a/net/ipv6/netfilter/ip6t_rt.c +++ b/net/ipv6/netfilter/ip6t_rt.c | |||
@@ -198,7 +198,7 @@ match(const struct sk_buff *skb, | |||
198 | } | 198 | } |
199 | 199 | ||
200 | /* Called when user tries to insert an entry of this type. */ | 200 | /* Called when user tries to insert an entry of this type. */ |
201 | static int | 201 | static bool |
202 | checkentry(const char *tablename, | 202 | checkentry(const char *tablename, |
203 | const void *entry, | 203 | const void *entry, |
204 | const struct xt_match *match, | 204 | const struct xt_match *match, |
@@ -209,17 +209,17 @@ checkentry(const char *tablename, | |||
209 | 209 | ||
210 | if (rtinfo->invflags & ~IP6T_RT_INV_MASK) { | 210 | if (rtinfo->invflags & ~IP6T_RT_INV_MASK) { |
211 | DEBUGP("ip6t_rt: unknown flags %X\n", rtinfo->invflags); | 211 | DEBUGP("ip6t_rt: unknown flags %X\n", rtinfo->invflags); |
212 | return 0; | 212 | return false; |
213 | } | 213 | } |
214 | if ((rtinfo->flags & (IP6T_RT_RES | IP6T_RT_FST_MASK)) && | 214 | if ((rtinfo->flags & (IP6T_RT_RES | IP6T_RT_FST_MASK)) && |
215 | (!(rtinfo->flags & IP6T_RT_TYP) || | 215 | (!(rtinfo->flags & IP6T_RT_TYP) || |
216 | (rtinfo->rt_type != 0) || | 216 | (rtinfo->rt_type != 0) || |
217 | (rtinfo->invflags & IP6T_RT_INV_TYP))) { | 217 | (rtinfo->invflags & IP6T_RT_INV_TYP))) { |
218 | DEBUGP("`--rt-type 0' required before `--rt-0-*'"); | 218 | DEBUGP("`--rt-type 0' required before `--rt-0-*'"); |
219 | return 0; | 219 | return false; |
220 | } | 220 | } |
221 | 221 | ||
222 | return 1; | 222 | return true; |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct xt_match rt_match = { | 225 | static struct xt_match rt_match = { |