diff options
author | Jan Engelhardt <jengelh@gmx.de> | 2007-07-08 01:15:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 01:16:57 -0400 |
commit | 1d93a9cbad608f6398ba6c5b588c504ccd35a2ca (patch) | |
tree | df02632a70f0438efb0e5baab9900f4f2acf98a1 /net/ipv4/netfilter/ipt_recent.c | |
parent | cff533ac12494fa002e2c46acc94d670e5f636a2 (diff) |
[NETFILTER]: x_tables: switch xt_match->match 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/ipv4/netfilter/ipt_recent.c')
-rw-r--r-- | net/ipv4/netfilter/ipt_recent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 81f1a017f31..2e513ed9b6e 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -169,7 +169,7 @@ static void recent_table_flush(struct recent_table *t) | |||
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | static int | 172 | static bool |
173 | ipt_recent_match(const struct sk_buff *skb, | 173 | ipt_recent_match(const struct sk_buff *skb, |
174 | const struct net_device *in, const struct net_device *out, | 174 | const struct net_device *in, const struct net_device *out, |
175 | const struct xt_match *match, const void *matchinfo, | 175 | const struct xt_match *match, const void *matchinfo, |
@@ -180,7 +180,7 @@ ipt_recent_match(const struct sk_buff *skb, | |||
180 | struct recent_entry *e; | 180 | struct recent_entry *e; |
181 | __be32 addr; | 181 | __be32 addr; |
182 | u_int8_t ttl; | 182 | u_int8_t ttl; |
183 | int ret = info->invert; | 183 | bool ret = info->invert; |
184 | 184 | ||
185 | if (info->side == IPT_RECENT_DEST) | 185 | if (info->side == IPT_RECENT_DEST) |
186 | addr = ip_hdr(skb)->daddr; | 186 | addr = ip_hdr(skb)->daddr; |
@@ -202,15 +202,15 @@ ipt_recent_match(const struct sk_buff *skb, | |||
202 | e = recent_entry_init(t, addr, ttl); | 202 | e = recent_entry_init(t, addr, ttl); |
203 | if (e == NULL) | 203 | if (e == NULL) |
204 | *hotdrop = true; | 204 | *hotdrop = true; |
205 | ret ^= 1; | 205 | ret = !ret; |
206 | goto out; | 206 | goto out; |
207 | } | 207 | } |
208 | 208 | ||
209 | if (info->check_set & IPT_RECENT_SET) | 209 | if (info->check_set & IPT_RECENT_SET) |
210 | ret ^= 1; | 210 | ret = !ret; |
211 | else if (info->check_set & IPT_RECENT_REMOVE) { | 211 | else if (info->check_set & IPT_RECENT_REMOVE) { |
212 | recent_entry_remove(t, e); | 212 | recent_entry_remove(t, e); |
213 | ret ^= 1; | 213 | ret = !ret; |
214 | } else if (info->check_set & (IPT_RECENT_CHECK | IPT_RECENT_UPDATE)) { | 214 | } else if (info->check_set & (IPT_RECENT_CHECK | IPT_RECENT_UPDATE)) { |
215 | unsigned long t = jiffies - info->seconds * HZ; | 215 | unsigned long t = jiffies - info->seconds * HZ; |
216 | unsigned int i, hits = 0; | 216 | unsigned int i, hits = 0; |
@@ -219,7 +219,7 @@ ipt_recent_match(const struct sk_buff *skb, | |||
219 | if (info->seconds && time_after(t, e->stamps[i])) | 219 | if (info->seconds && time_after(t, e->stamps[i])) |
220 | continue; | 220 | continue; |
221 | if (++hits >= info->hit_count) { | 221 | if (++hits >= info->hit_count) { |
222 | ret ^= 1; | 222 | ret = !ret; |
223 | break; | 223 | break; |
224 | } | 224 | } |
225 | } | 225 | } |