提交 e1fd0586 编写于 作者: J Jan Engelhardt 提交者: David S. Miller

[NETFILTER]: x_tables: fix return values for LOG/ULOG

Signed-off-by: NJan Engelhardt <jengelh@gmx.de>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 41f4689a
...@@ -471,8 +471,11 @@ static struct nf_logger ipt_log_logger ={ ...@@ -471,8 +471,11 @@ static struct nf_logger ipt_log_logger ={
static int __init ipt_log_init(void) static int __init ipt_log_init(void)
{ {
if (ipt_register_target(&ipt_log_reg)) int ret;
return -EINVAL;
ret = ipt_register_target(&ipt_log_reg);
if (ret < 0)
return ret;
if (nf_log_register(PF_INET, &ipt_log_logger) < 0) { if (nf_log_register(PF_INET, &ipt_log_logger) < 0) {
printk(KERN_WARNING "ipt_LOG: not logging via system console " printk(KERN_WARNING "ipt_LOG: not logging via system console "
"since somebody else already registered for PF_INET\n"); "since somebody else already registered for PF_INET\n");
......
...@@ -379,7 +379,7 @@ static struct nf_logger ipt_ulog_logger = { ...@@ -379,7 +379,7 @@ static struct nf_logger ipt_ulog_logger = {
static int __init ipt_ulog_init(void) static int __init ipt_ulog_init(void)
{ {
int i; int ret, i;
DEBUGP("ipt_ULOG: init module\n"); DEBUGP("ipt_ULOG: init module\n");
...@@ -400,9 +400,10 @@ static int __init ipt_ulog_init(void) ...@@ -400,9 +400,10 @@ static int __init ipt_ulog_init(void)
if (!nflognl) if (!nflognl)
return -ENOMEM; return -ENOMEM;
if (ipt_register_target(&ipt_ulog_reg) != 0) { ret = ipt_register_target(&ipt_ulog_reg);
if (ret < 0) {
sock_release(nflognl->sk_socket); sock_release(nflognl->sk_socket);
return -EINVAL; return ret;
} }
if (nflog) if (nflog)
nf_log_register(PF_INET, &ipt_ulog_logger); nf_log_register(PF_INET, &ipt_ulog_logger);
......
...@@ -482,8 +482,11 @@ static struct nf_logger ip6t_logger = { ...@@ -482,8 +482,11 @@ static struct nf_logger ip6t_logger = {
static int __init ip6t_log_init(void) static int __init ip6t_log_init(void)
{ {
if (ip6t_register_target(&ip6t_log_reg)) int ret;
return -EINVAL;
ret = ip6t_register_target(&ip6t_log_reg);
if (ret < 0)
return ret;
if (nf_log_register(PF_INET6, &ip6t_logger) < 0) { if (nf_log_register(PF_INET6, &ip6t_logger) < 0) {
printk(KERN_WARNING "ip6t_LOG: not logging via system console " printk(KERN_WARNING "ip6t_LOG: not logging via system console "
"since somebody else already registered for PF_INET6\n"); "since somebody else already registered for PF_INET6\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册