aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-06-18 13:38:25 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2014-06-27 07:20:13 -0400
commitfab4085f4e248b8a80bb1dadbbacb2bacd8017c3 (patch)
tree4d17c20935c24f77f08fe7807ce5a038d8a2cb13 /net/ipv4
parent83e96d443b372611adf19e4171d41deb1d8760cf (diff)
netfilter: log: nf_log_packet() as real unified interface
Before this patch, the nf_loginfo parameter specified the logging configuration in case the specified default logger was loaded. This patch updates the semantics of the nf_loginfo parameter in nf_log_packet() which now indicates the logger that you explicitly want to use. Thus, nf_log_packet() is exposed as an unified interface which internally routes the log message to the corresponding logger type by family. The module dependencies are expressed by the new nf_logger_find_get() and nf_logger_put() functions which bump the logger module refcount. Thus, you can not remove logger modules that are used by rules anymore. Another important effect of this change is that the family specific module is only loaded when required. Therefore, xt_LOG and nft_log will just trigger the autoload of the nf_log_{ip,ip6} modules according to the family. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/nf_log_ipv4.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/netfilter/nf_log_ipv4.c b/net/ipv4/netfilter/nf_log_ipv4.c
index 7e69a401a29e..078bdca1b607 100644
--- a/net/ipv4/netfilter/nf_log_ipv4.c
+++ b/net/ipv4/netfilter/nf_log_ipv4.c
@@ -306,12 +306,12 @@ fallback:
306 nf_log_buf_add(m, " "); 306 nf_log_buf_add(m, " ");
307} 307}
308 308
309void nf_log_ip_packet(struct net *net, u_int8_t pf, 309static void nf_log_ip_packet(struct net *net, u_int8_t pf,
310 unsigned int hooknum, const struct sk_buff *skb, 310 unsigned int hooknum, const struct sk_buff *skb,
311 const struct net_device *in, 311 const struct net_device *in,
312 const struct net_device *out, 312 const struct net_device *out,
313 const struct nf_loginfo *loginfo, 313 const struct nf_loginfo *loginfo,
314 const char *prefix) 314 const char *prefix)
315{ 315{
316 struct nf_log_buf *m; 316 struct nf_log_buf *m;
317 317
@@ -334,7 +334,6 @@ void nf_log_ip_packet(struct net *net, u_int8_t pf,
334 334
335 nf_log_buf_close(m); 335 nf_log_buf_close(m);
336} 336}
337EXPORT_SYMBOL_GPL(nf_log_ip_packet);
338 337
339static struct nf_logger nf_ip_logger __read_mostly = { 338static struct nf_logger nf_ip_logger __read_mostly = {
340 .name = "nf_log_ipv4", 339 .name = "nf_log_ipv4",
@@ -383,3 +382,4 @@ module_exit(nf_log_ipv4_exit);
383MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); 382MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
384MODULE_DESCRIPTION("Netfilter IPv4 packet logging"); 383MODULE_DESCRIPTION("Netfilter IPv4 packet logging");
385MODULE_LICENSE("GPL"); 384MODULE_LICENSE("GPL");
385MODULE_ALIAS_NF_LOGGER(AF_INET, 0);