]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NETFILTER]: Fix logging regression
authorPatrick McHardy <kaber@trash.net>
Tue, 24 Jul 2007 22:29:55 +0000 (15:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2007 22:29:55 +0000 (15:29 -0700)
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>
net/bridge/netfilter/ebt_log.c
net/bridge/netfilter/ebt_ulog.c
net/ipv4/netfilter/ipt_LOG.c
net/ipv6/netfilter/ip6t_LOG.c

index 031bfa4a51fc0c8a25d7d7f92810183f577cbaea..984e9c64fb80304ec47a55b9f957159a3f60cece 100644 (file)
@@ -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)
index 9411db62591754b5592a783040e48763ddc92514..6fec35225699347f92b5c6f16a62cc5e214672b4 100644 (file)
@@ -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;
 }
index 5937ad150b9f8a77b855857cb6c828c0b3e7c154..127a5e89bf14c6f75ae4f83a2bcf34abf7783232 100644 (file)
@@ -479,10 +479,8 @@ static int __init ipt_log_init(void)
        ret = xt_register_target(&ipt_log_reg);
        if (ret < 0)
                return ret;
-       ret = nf_log_register(PF_INET, &ipt_log_logger);
-       if (ret < 0 && ret != -EEXIST)
-               xt_unregister_target(&ipt_log_reg);
-       return ret;
+       nf_log_register(PF_INET, &ipt_log_logger);
+       return 0;
 }
 
 static void __exit ipt_log_fini(void)
index b05327ebd3320fe01768ed420da40a2751514587..6ab99001dcccb321bedb88c57b95f812e9aef412 100644 (file)
@@ -493,10 +493,8 @@ static int __init ip6t_log_init(void)
        ret = xt_register_target(&ip6t_log_reg);
        if (ret < 0)
                return ret;
-       ret = nf_log_register(PF_INET6, &ip6t_logger);
-       if (ret < 0 && ret != -EEXIST)
-               xt_unregister_target(&ip6t_log_reg);
-       return ret;
+       nf_log_register(PF_INET6, &ip6t_logger);
+       return 0;
 }
 
 static void __exit ip6t_log_fini(void)