aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-02-12 14:11:55 -0500
committerDavid S. Miller <davem@davemloft.net>2007-02-12 14:11:55 -0500
commite92ad99c78de09a5ba0746e1c0ee27cc7450c64d (patch)
tree6ed2fcfbfdd88738fcf90dc5d25274246dcee07d
parent9b73534dc57fa2fd5ef567586adb83c16e88a52f (diff)
[NETFILTER]: nf_log: minor cleanups
- rename nf_logging to nf_loggers since its an array of registered loggers - rename nf_log_unregister_logger() to nf_log_unregister() to make it symetrical to nf_log_register() and convert all users Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netfilter.h2
-rw-r--r--net/bridge/netfilter/ebt_log.c2
-rw-r--r--net/bridge/netfilter/ebt_ulog.c2
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c2
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c2
-rw-r--r--net/ipv6/netfilter/ip6t_LOG.c2
-rw-r--r--net/netfilter/nf_log.c22
-rw-r--r--net/netfilter/nfnetlink_log.c2
8 files changed, 18 insertions, 18 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 18a67908a330..70d3b4f1e48d 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -172,8 +172,8 @@ struct nf_logger {
172 172
173/* Function to register/unregister log function. */ 173/* Function to register/unregister log function. */
174int nf_log_register(int pf, struct nf_logger *logger); 174int nf_log_register(int pf, struct nf_logger *logger);
175void nf_log_unregister(struct nf_logger *logger);
175void nf_log_unregister_pf(int pf); 176void nf_log_unregister_pf(int pf);
176void nf_log_unregister_logger(struct nf_logger *logger);
177 177
178/* Calls the registered backend logging function */ 178/* Calls the registered backend logging function */
179void nf_log_packet(int pf, 179void nf_log_packet(int pf,
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c
index f9a5ae9d5b6d..45712aec6a0e 100644
--- a/net/bridge/netfilter/ebt_log.c
+++ b/net/bridge/netfilter/ebt_log.c
@@ -208,7 +208,7 @@ static int __init ebt_log_init(void)
208 208
209static void __exit ebt_log_fini(void) 209static void __exit ebt_log_fini(void)
210{ 210{
211 nf_log_unregister_logger(&ebt_log_logger); 211 nf_log_unregister(&ebt_log_logger);
212 ebt_unregister_watcher(&log); 212 ebt_unregister_watcher(&log);
213} 213}
214 214
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index 2e4cb24e191a..8e15cc47f6c0 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -323,7 +323,7 @@ static void __exit ebt_ulog_fini(void)
323 ebt_ulog_buff_t *ub; 323 ebt_ulog_buff_t *ub;
324 int i; 324 int i;
325 325
326 nf_log_unregister_logger(&ebt_ulog_logger); 326 nf_log_unregister(&ebt_ulog_logger);
327 ebt_unregister_watcher(&ulog); 327 ebt_unregister_watcher(&ulog);
328 for (i = 0; i < EBT_ULOG_MAXNLGROUPS; i++) { 328 for (i = 0; i < EBT_ULOG_MAXNLGROUPS; i++) {
329 ub = &ulog_buffers[i]; 329 ub = &ulog_buffers[i];
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index f4a62f2522ff..d9c37fd94228 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -489,7 +489,7 @@ static int __init ipt_log_init(void)
489 489
490static void __exit ipt_log_fini(void) 490static void __exit ipt_log_fini(void)
491{ 491{
492 nf_log_unregister_logger(&ipt_log_logger); 492 nf_log_unregister(&ipt_log_logger);
493 xt_unregister_target(&ipt_log_reg); 493 xt_unregister_target(&ipt_log_reg);
494} 494}
495 495
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index 3a1eacc634b3..a26404dbe212 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -419,7 +419,7 @@ static void __exit ipt_ulog_fini(void)
419 DEBUGP("ipt_ULOG: cleanup_module\n"); 419 DEBUGP("ipt_ULOG: cleanup_module\n");
420 420
421 if (nflog) 421 if (nflog)
422 nf_log_unregister_logger(&ipt_ulog_logger); 422 nf_log_unregister(&ipt_ulog_logger);
423 xt_unregister_target(&ipt_ulog_reg); 423 xt_unregister_target(&ipt_ulog_reg);
424 sock_release(nflognl->sk_socket); 424 sock_release(nflognl->sk_socket);
425 425
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index dc9ec9305778..afaa039d0b7b 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -501,7 +501,7 @@ static int __init ip6t_log_init(void)
501 501
502static void __exit ip6t_log_fini(void) 502static void __exit ip6t_log_fini(void)
503{ 503{
504 nf_log_unregister_logger(&ip6t_logger); 504 nf_log_unregister(&ip6t_logger);
505 xt_unregister_target(&ip6t_log_reg); 505 xt_unregister_target(&ip6t_log_reg);
506} 506}
507 507
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index 243d66b1c02c..c48aab50341d 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -14,7 +14,7 @@
14 14
15#define NF_LOG_PREFIXLEN 128 15#define NF_LOG_PREFIXLEN 128
16 16
17static struct nf_logger *nf_logging[NPROTO]; /* = NULL */ 17static struct nf_logger *nf_loggers[NPROTO];
18static DEFINE_MUTEX(nf_log_mutex); 18static DEFINE_MUTEX(nf_log_mutex);
19 19
20/* return EBUSY if somebody else is registered, EEXIST if the same logger 20/* return EBUSY if somebody else is registered, EEXIST if the same logger
@@ -32,9 +32,9 @@ int nf_log_register(int pf, struct nf_logger *logger)
32 if (ret < 0) 32 if (ret < 0)
33 return ret; 33 return ret;
34 34
35 if (!nf_logging[pf]) 35 if (!nf_loggers[pf])
36 rcu_assign_pointer(nf_logging[pf], logger); 36 rcu_assign_pointer(nf_loggers[pf], logger);
37 else if (nf_logging[pf] == logger) 37 else if (nf_loggers[pf] == logger)
38 ret = -EEXIST; 38 ret = -EEXIST;
39 else 39 else
40 ret = -EBUSY; 40 ret = -EBUSY;
@@ -49,7 +49,7 @@ void nf_log_unregister_pf(int pf)
49 if (pf >= NPROTO) 49 if (pf >= NPROTO)
50 return; 50 return;
51 mutex_lock(&nf_log_mutex); 51 mutex_lock(&nf_log_mutex);
52 rcu_assign_pointer(nf_logging[pf], NULL); 52 rcu_assign_pointer(nf_loggers[pf], NULL);
53 mutex_unlock(&nf_log_mutex); 53 mutex_unlock(&nf_log_mutex);
54 54
55 /* Give time to concurrent readers. */ 55 /* Give time to concurrent readers. */
@@ -57,20 +57,20 @@ void nf_log_unregister_pf(int pf)
57} 57}
58EXPORT_SYMBOL(nf_log_unregister_pf); 58EXPORT_SYMBOL(nf_log_unregister_pf);
59 59
60void nf_log_unregister_logger(struct nf_logger *logger) 60void nf_log_unregister(struct nf_logger *logger)
61{ 61{
62 int i; 62 int i;
63 63
64 mutex_lock(&nf_log_mutex); 64 mutex_lock(&nf_log_mutex);
65 for (i = 0; i < NPROTO; i++) { 65 for (i = 0; i < NPROTO; i++) {
66 if (nf_logging[i] == logger) 66 if (nf_loggers[i] == logger)
67 rcu_assign_pointer(nf_logging[i], NULL); 67 rcu_assign_pointer(nf_loggers[i], NULL);
68 } 68 }
69 mutex_unlock(&nf_log_mutex); 69 mutex_unlock(&nf_log_mutex);
70 70
71 synchronize_rcu(); 71 synchronize_rcu();
72} 72}
73EXPORT_SYMBOL(nf_log_unregister_logger); 73EXPORT_SYMBOL(nf_log_unregister);
74 74
75void nf_log_packet(int pf, 75void nf_log_packet(int pf,
76 unsigned int hooknum, 76 unsigned int hooknum,
@@ -85,7 +85,7 @@ void nf_log_packet(int pf,
85 struct nf_logger *logger; 85 struct nf_logger *logger;
86 86
87 rcu_read_lock(); 87 rcu_read_lock();
88 logger = rcu_dereference(nf_logging[pf]); 88 logger = rcu_dereference(nf_loggers[pf]);
89 if (logger) { 89 if (logger) {
90 va_start(args, fmt); 90 va_start(args, fmt);
91 vsnprintf(prefix, sizeof(prefix), fmt, args); 91 vsnprintf(prefix, sizeof(prefix), fmt, args);
@@ -132,7 +132,7 @@ static int seq_show(struct seq_file *s, void *v)
132 loff_t *pos = v; 132 loff_t *pos = v;
133 const struct nf_logger *logger; 133 const struct nf_logger *logger;
134 134
135 logger = rcu_dereference(nf_logging[*pos]); 135 logger = rcu_dereference(nf_loggers[*pos]);
136 136
137 if (!logger) 137 if (!logger)
138 return seq_printf(s, "%2lld NONE\n", *pos); 138 return seq_printf(s, "%2lld NONE\n", *pos);
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index c47e7e2ba642..edbb8ff635cc 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -1077,7 +1077,7 @@ cleanup_netlink_notifier:
1077 1077
1078static void __exit nfnetlink_log_fini(void) 1078static void __exit nfnetlink_log_fini(void)
1079{ 1079{
1080 nf_log_unregister_logger(&nfulnl_logger); 1080 nf_log_unregister(&nfulnl_logger);
1081#ifdef CONFIG_PROC_FS 1081#ifdef CONFIG_PROC_FS
1082 remove_proc_entry("nfnetlink_log", proc_net_netfilter); 1082 remove_proc_entry("nfnetlink_log", proc_net_netfilter);
1083#endif 1083#endif