diff options
author | Jan Engelhardt <jengelh@gmx.de> | 2007-07-08 01:16:26 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 01:16:59 -0400 |
commit | e1931b784a8de324abf310fa3b5e3f25d3988233 (patch) | |
tree | 3f553c7fed76a21efc96cc0eb4fa7bd69722f94d /net/ipv4/netfilter/ipt_CLUSTERIP.c | |
parent | ccb79bdce71f2c04cfa9bfcbaf4d37e2f963d684 (diff) |
[NETFILTER]: x_tables: switch xt_target->checkentry to bool
Switch the return type of target checkentry 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_CLUSTERIP.c')
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 40e27342139..e82339a78c0 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -220,17 +220,17 @@ clusterip_add_node(struct clusterip_config *c, u_int16_t nodenum) | |||
220 | return 0; | 220 | return 0; |
221 | } | 221 | } |
222 | 222 | ||
223 | static int | 223 | static bool |
224 | clusterip_del_node(struct clusterip_config *c, u_int16_t nodenum) | 224 | clusterip_del_node(struct clusterip_config *c, u_int16_t nodenum) |
225 | { | 225 | { |
226 | if (nodenum == 0 || | 226 | if (nodenum == 0 || |
227 | nodenum > c->num_total_nodes) | 227 | nodenum > c->num_total_nodes) |
228 | return 1; | 228 | return true; |
229 | 229 | ||
230 | if (test_and_clear_bit(nodenum - 1, &c->local_nodes)) | 230 | if (test_and_clear_bit(nodenum - 1, &c->local_nodes)) |
231 | return 0; | 231 | return false; |
232 | 232 | ||
233 | return 1; | 233 | return true; |
234 | } | 234 | } |
235 | #endif | 235 | #endif |
236 | 236 | ||
@@ -370,7 +370,7 @@ target(struct sk_buff **pskb, | |||
370 | return XT_CONTINUE; | 370 | return XT_CONTINUE; |
371 | } | 371 | } |
372 | 372 | ||
373 | static int | 373 | static bool |
374 | checkentry(const char *tablename, | 374 | checkentry(const char *tablename, |
375 | const void *e_void, | 375 | const void *e_void, |
376 | const struct xt_target *target, | 376 | const struct xt_target *target, |
@@ -387,13 +387,13 @@ checkentry(const char *tablename, | |||
387 | cipinfo->hash_mode != CLUSTERIP_HASHMODE_SIP_SPT_DPT) { | 387 | cipinfo->hash_mode != CLUSTERIP_HASHMODE_SIP_SPT_DPT) { |
388 | printk(KERN_WARNING "CLUSTERIP: unknown mode `%u'\n", | 388 | printk(KERN_WARNING "CLUSTERIP: unknown mode `%u'\n", |
389 | cipinfo->hash_mode); | 389 | cipinfo->hash_mode); |
390 | return 0; | 390 | return false; |
391 | 391 | ||
392 | } | 392 | } |
393 | if (e->ip.dmsk.s_addr != htonl(0xffffffff) | 393 | if (e->ip.dmsk.s_addr != htonl(0xffffffff) |
394 | || e->ip.dst.s_addr == 0) { | 394 | || e->ip.dst.s_addr == 0) { |
395 | printk(KERN_ERR "CLUSTERIP: Please specify destination IP\n"); | 395 | printk(KERN_ERR "CLUSTERIP: Please specify destination IP\n"); |
396 | return 0; | 396 | return false; |
397 | } | 397 | } |
398 | 398 | ||
399 | /* FIXME: further sanity checks */ | 399 | /* FIXME: further sanity checks */ |
@@ -407,7 +407,7 @@ checkentry(const char *tablename, | |||
407 | if (cipinfo->config != config) { | 407 | if (cipinfo->config != config) { |
408 | printk(KERN_ERR "CLUSTERIP: Reloaded entry " | 408 | printk(KERN_ERR "CLUSTERIP: Reloaded entry " |
409 | "has invalid config pointer!\n"); | 409 | "has invalid config pointer!\n"); |
410 | return 0; | 410 | return false; |
411 | } | 411 | } |
412 | } else { | 412 | } else { |
413 | /* Case B: This is a new rule referring to an existing | 413 | /* Case B: This is a new rule referring to an existing |
@@ -418,19 +418,19 @@ checkentry(const char *tablename, | |||
418 | /* Case C: This is a completely new clusterip config */ | 418 | /* Case C: This is a completely new clusterip config */ |
419 | if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) { | 419 | if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) { |
420 | printk(KERN_WARNING "CLUSTERIP: no config found for %u.%u.%u.%u, need 'new'\n", NIPQUAD(e->ip.dst.s_addr)); | 420 | printk(KERN_WARNING "CLUSTERIP: no config found for %u.%u.%u.%u, need 'new'\n", NIPQUAD(e->ip.dst.s_addr)); |
421 | return 0; | 421 | return false; |
422 | } else { | 422 | } else { |
423 | struct net_device *dev; | 423 | struct net_device *dev; |
424 | 424 | ||
425 | if (e->ip.iniface[0] == '\0') { | 425 | if (e->ip.iniface[0] == '\0') { |
426 | printk(KERN_WARNING "CLUSTERIP: Please specify an interface name\n"); | 426 | printk(KERN_WARNING "CLUSTERIP: Please specify an interface name\n"); |
427 | return 0; | 427 | return false; |
428 | } | 428 | } |
429 | 429 | ||
430 | dev = dev_get_by_name(e->ip.iniface); | 430 | dev = dev_get_by_name(e->ip.iniface); |
431 | if (!dev) { | 431 | if (!dev) { |
432 | printk(KERN_WARNING "CLUSTERIP: no such interface %s\n", e->ip.iniface); | 432 | printk(KERN_WARNING "CLUSTERIP: no such interface %s\n", e->ip.iniface); |
433 | return 0; | 433 | return false; |
434 | } | 434 | } |
435 | 435 | ||
436 | config = clusterip_config_init(cipinfo, | 436 | config = clusterip_config_init(cipinfo, |
@@ -438,7 +438,7 @@ checkentry(const char *tablename, | |||
438 | if (!config) { | 438 | if (!config) { |
439 | printk(KERN_WARNING "CLUSTERIP: cannot allocate config\n"); | 439 | printk(KERN_WARNING "CLUSTERIP: cannot allocate config\n"); |
440 | dev_put(dev); | 440 | dev_put(dev); |
441 | return 0; | 441 | return false; |
442 | } | 442 | } |
443 | dev_mc_add(config->dev,config->clustermac, ETH_ALEN, 0); | 443 | dev_mc_add(config->dev,config->clustermac, ETH_ALEN, 0); |
444 | } | 444 | } |
@@ -448,10 +448,10 @@ checkentry(const char *tablename, | |||
448 | if (nf_ct_l3proto_try_module_get(target->family) < 0) { | 448 | if (nf_ct_l3proto_try_module_get(target->family) < 0) { |
449 | printk(KERN_WARNING "can't load conntrack support for " | 449 | printk(KERN_WARNING "can't load conntrack support for " |
450 | "proto=%d\n", target->family); | 450 | "proto=%d\n", target->family); |
451 | return 0; | 451 | return false; |
452 | } | 452 | } |
453 | 453 | ||
454 | return 1; | 454 | return true; |
455 | } | 455 | } |
456 | 456 | ||
457 | /* drop reference count of cluster config when rule is deleted */ | 457 | /* drop reference count of cluster config when rule is deleted */ |