netfilter: log: protect nf_log_register against double registering
authorMarcelo Leitner <mleitner@redhat.com>
Wed, 29 Oct 2014 12:51:13 +0000 (10:51 -0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 30 Oct 2014 15:41:48 +0000 (16:41 +0100)
commit8ac2bde2a4a05c38e2bd733bea94507cb1461e06
tree2628cb85dd882e24e0b4dd8a76d5a4ee5330aaf5
parent0c26ed1c07f13ca27e2638ffdd1951013ed96c48
netfilter: log: protect nf_log_register against double registering

Currently, despite the comment right before the function,
nf_log_register allows registering two loggers on with the same type and
end up overwriting the previous register.

Not a real issue today as current tree doesn't have two loggers for the
same type but it's better to get this protected.

Also make sure that all of its callers do error checking.

Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_log_arp.c
net/ipv4/netfilter/nf_log_ipv4.c
net/ipv6/netfilter/nf_log_ipv6.c
net/netfilter/nf_log.c