diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-24 15:29:55 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-07-24 15:29:55 -0700 |
commit | 7e2acc7e2711d51705373ac201333c9a0ebd3950 (patch) | |
tree | 06bd3d776970a2e09bfca5c67dad4490fd1ea7c0 /net/bridge | |
parent | ca983cefd950ec929582dd95ba6e46d12c2c6959 (diff) | |
download | linux-7e2acc7e2711d51705373ac201333c9a0ebd3950.tar.bz2 |
[NETFILTER]: Fix logging regression
Loading one of the LOG target fails if a different target has already
registered itself as backend for the same family. This can affect the
ipt_LOG and ipt_ULOG modules when both are loaded.
Reported and tested by: <t.artem@mailcity.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/netfilter/ebt_log.c | 6 | ||||
-rw-r--r-- | net/bridge/netfilter/ebt_ulog.c | 8 |
2 files changed, 4 insertions, 10 deletions
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index 031bfa4a51fc..984e9c64fb80 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c @@ -196,10 +196,8 @@ static int __init ebt_log_init(void) ret = ebt_register_watcher(&log); if (ret < 0) return ret; - ret = nf_log_register(PF_BRIDGE, &ebt_log_logger); - if (ret < 0 && ret != -EEXIST) - ebt_unregister_watcher(&log); - return ret; + nf_log_register(PF_BRIDGE, &ebt_log_logger); + return 0; } static void __exit ebt_log_fini(void) diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index 9411db625917..6fec35225699 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c @@ -308,12 +308,8 @@ static int __init ebt_ulog_init(void) else if ((ret = ebt_register_watcher(&ulog))) sock_release(ebtulognl->sk_socket); - if (nf_log_register(PF_BRIDGE, &ebt_ulog_logger) < 0) { - printk(KERN_WARNING "ebt_ulog: not logging via ulog " - "since somebody else already registered for PF_BRIDGE\n"); - /* we cannot make module load fail here, since otherwise - * ebtables userspace would abort */ - } + if (ret == 0) + nf_log_register(PF_BRIDGE, &ebt_ulog_logger); return ret; } |