aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/ipt_CLUSTERIP.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/netfilter/ipt_CLUSTERIP.c')
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 290a7b9b393..1302de2ae0a 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -358,13 +358,13 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
358 cipinfo->hash_mode != CLUSTERIP_HASHMODE_SIP_SPT && 358 cipinfo->hash_mode != CLUSTERIP_HASHMODE_SIP_SPT &&
359 cipinfo->hash_mode != CLUSTERIP_HASHMODE_SIP_SPT_DPT) { 359 cipinfo->hash_mode != CLUSTERIP_HASHMODE_SIP_SPT_DPT) {
360 pr_info("unknown mode %u\n", cipinfo->hash_mode); 360 pr_info("unknown mode %u\n", cipinfo->hash_mode);
361 return false; 361 return -EINVAL;
362 362
363 } 363 }
364 if (e->ip.dmsk.s_addr != htonl(0xffffffff) || 364 if (e->ip.dmsk.s_addr != htonl(0xffffffff) ||
365 e->ip.dst.s_addr == 0) { 365 e->ip.dst.s_addr == 0) {
366 pr_info("Please specify destination IP\n"); 366 pr_info("Please specify destination IP\n");
367 return false; 367 return -EINVAL;
368 } 368 }
369 369
370 /* FIXME: further sanity checks */ 370 /* FIXME: further sanity checks */
@@ -374,20 +374,20 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
374 if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) { 374 if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) {
375 pr_info("no config found for %pI4, need 'new'\n", 375 pr_info("no config found for %pI4, need 'new'\n",
376 &e->ip.dst.s_addr); 376 &e->ip.dst.s_addr);
377 return false; 377 return -EINVAL;
378 } else { 378 } else {
379 struct net_device *dev; 379 struct net_device *dev;
380 380
381 if (e->ip.iniface[0] == '\0') { 381 if (e->ip.iniface[0] == '\0') {
382 pr_info("Please specify an interface name\n"); 382 pr_info("Please specify an interface name\n");
383 return false; 383 return -EINVAL;
384 } 384 }
385 385
386 dev = dev_get_by_name(&init_net, e->ip.iniface); 386 dev = dev_get_by_name(&init_net, e->ip.iniface);
387 if (!dev) { 387 if (!dev) {
388 pr_info("no such interface %s\n", 388 pr_info("no such interface %s\n",
389 e->ip.iniface); 389 e->ip.iniface);
390 return false; 390 return -EINVAL;
391 } 391 }
392 392
393 config = clusterip_config_init(cipinfo, 393 config = clusterip_config_init(cipinfo,
@@ -395,7 +395,7 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
395 if (!config) { 395 if (!config) {
396 pr_info("cannot allocate config\n"); 396 pr_info("cannot allocate config\n");
397 dev_put(dev); 397 dev_put(dev);
398 return false; 398 return -EINVAL;
399 } 399 }
400 dev_mc_add(config->dev,config->clustermac, ETH_ALEN, 0); 400 dev_mc_add(config->dev,config->clustermac, ETH_ALEN, 0);
401 } 401 }
@@ -405,10 +405,10 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
405 if (nf_ct_l3proto_try_module_get(par->family) < 0) { 405 if (nf_ct_l3proto_try_module_get(par->family) < 0) {
406 pr_info("cannot load conntrack support for proto=%u\n", 406 pr_info("cannot load conntrack support for proto=%u\n",
407 par->family); 407 par->family);
408 return false; 408 return -EINVAL;
409 } 409 }
410 410
411 return true; 411 return 0;
412} 412}
413 413
414/* drop reference count of cluster config when rule is deleted */ 414/* drop reference count of cluster config when rule is deleted */