diff options
author | Jan Engelhardt <jengelh@gmx.de> | 2007-02-07 18:10:34 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-08 15:39:18 -0500 |
commit | e1fd0586b04d624c597834320d9e57d6f2f4b878 (patch) | |
tree | 39f83e45057d472839f1d7a9ffbf51bbfe377d8d /net/ipv4 | |
parent | 41f4689a7c8cd76b77864461b3c58fde8f322b2c (diff) |
[NETFILTER]: x_tables: fix return values for LOG/ULOG
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')
-rw-r--r-- | net/ipv4/netfilter/ipt_LOG.c | 7 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index c96de16fefae..37778c72aeaa 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c | |||
@@ -471,8 +471,11 @@ static struct nf_logger ipt_log_logger ={ | |||
471 | 471 | ||
472 | static int __init ipt_log_init(void) | 472 | static int __init ipt_log_init(void) |
473 | { | 473 | { |
474 | if (ipt_register_target(&ipt_log_reg)) | 474 | int ret; |
475 | return -EINVAL; | 475 | |
476 | ret = ipt_register_target(&ipt_log_reg); | ||
477 | if (ret < 0) | ||
478 | return ret; | ||
476 | if (nf_log_register(PF_INET, &ipt_log_logger) < 0) { | 479 | if (nf_log_register(PF_INET, &ipt_log_logger) < 0) { |
477 | printk(KERN_WARNING "ipt_LOG: not logging via system console " | 480 | printk(KERN_WARNING "ipt_LOG: not logging via system console " |
478 | "since somebody else already registered for PF_INET\n"); | 481 | "since somebody else already registered for PF_INET\n"); |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index dbd34783a64d..a47e279eaac2 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -379,7 +379,7 @@ static struct nf_logger ipt_ulog_logger = { | |||
379 | 379 | ||
380 | static int __init ipt_ulog_init(void) | 380 | static int __init ipt_ulog_init(void) |
381 | { | 381 | { |
382 | int i; | 382 | int ret, i; |
383 | 383 | ||
384 | DEBUGP("ipt_ULOG: init module\n"); | 384 | DEBUGP("ipt_ULOG: init module\n"); |
385 | 385 | ||
@@ -400,9 +400,10 @@ static int __init ipt_ulog_init(void) | |||
400 | if (!nflognl) | 400 | if (!nflognl) |
401 | return -ENOMEM; | 401 | return -ENOMEM; |
402 | 402 | ||
403 | if (ipt_register_target(&ipt_ulog_reg) != 0) { | 403 | ret = ipt_register_target(&ipt_ulog_reg); |
404 | if (ret < 0) { | ||
404 | sock_release(nflognl->sk_socket); | 405 | sock_release(nflognl->sk_socket); |
405 | return -EINVAL; | 406 | return ret; |
406 | } | 407 | } |
407 | if (nflog) | 408 | if (nflog) |
408 | nf_log_register(PF_INET, &ipt_ulog_logger); | 409 | nf_log_register(PF_INET, &ipt_ulog_logger); |