[NETFILTER]: nf_log: constify struct nf_logger and nf_log_packet loginfo arg
authorPatrick McHardy <kaber@trash.net>
Tue, 18 Dec 2007 06:39:08 +0000 (22:39 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:58:59 +0000 (14:58 -0800)
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netfilter/nf_log.h
net/bridge/netfilter/ebt_log.c
net/bridge/netfilter/ebt_ulog.c
net/ipv4/netfilter/ipt_LOG.c
net/ipv6/netfilter/ip6t_LOG.c
net/netfilter/nf_log.c
net/netfilter/nfnetlink_log.c

index f0426e5..037e824 100644 (file)
@@ -43,8 +43,8 @@ struct nf_logger {
 };
 
 /* Function to register/unregister log function. */
-int nf_log_register(int pf, struct nf_logger *logger);
-void nf_log_unregister(struct nf_logger *logger);
+int nf_log_register(int pf, const struct nf_logger *logger);
+void nf_log_unregister(const struct nf_logger *logger);
 void nf_log_unregister_pf(int pf);
 
 /* Calls the registered backend logging function */
@@ -53,7 +53,7 @@ void nf_log_packet(int pf,
                   const struct sk_buff *skb,
                   const struct net_device *in,
                   const struct net_device *out,
-                  struct nf_loginfo *li,
+                  const struct nf_loginfo *li,
                   const char *fmt, ...);
 
 #endif /* _NF_LOG_H */
index fcb3b54..3be9e98 100644 (file)
@@ -183,7 +183,7 @@ static struct ebt_watcher log =
        .me             = THIS_MODULE,
 };
 
-static struct nf_logger ebt_log_logger = {
+static const struct nf_logger ebt_log_logger = {
        .name           = "ebt_log",
        .logfn          = &ebt_log_packet,
        .me             = THIS_MODULE,
index 1b9ca07..b73ba28 100644 (file)
@@ -279,7 +279,7 @@ static struct ebt_watcher ulog = {
        .me             = THIS_MODULE,
 };
 
-static struct nf_logger ebt_ulog_logger = {
+static const struct nf_logger ebt_ulog_logger = {
        .name           = EBT_ULOG_WATCHER,
        .logfn          = &ebt_log_packet,
        .me             = THIS_MODULE,
index 4b346e5..5acdddf 100644 (file)
@@ -465,7 +465,7 @@ static struct xt_target log_tg_reg __read_mostly = {
        .me             = THIS_MODULE,
 };
 
-static struct nf_logger ipt_log_logger ={
+static const struct nf_logger ipt_log_logger ={
        .name           = "ipt_LOG",
        .logfn          = &ipt_log_packet,
        .me             = THIS_MODULE,
index e6a2b1e..474c2b1 100644 (file)
@@ -478,7 +478,7 @@ static struct xt_target log_tg6_reg __read_mostly = {
        .me             = THIS_MODULE,
 };
 
-static struct nf_logger ip6t_logger = {
+static const struct nf_logger ip6t_logger = {
        .name           = "ip6t_LOG",
        .logfn          = &ip6t_log_packet,
        .me             = THIS_MODULE,
index fad97d6..ed9116d 100644 (file)
 
 #define NF_LOG_PREFIXLEN               128
 
-static struct nf_logger *nf_loggers[NPROTO];
+static const struct nf_logger *nf_loggers[NPROTO] __read_mostly;
 static DEFINE_MUTEX(nf_log_mutex);
 
 /* return EBUSY if somebody else is registered, EEXIST if the same logger
  * is registred, 0 on success. */
-int nf_log_register(int pf, struct nf_logger *logger)
+int nf_log_register(int pf, const struct nf_logger *logger)
 {
        int ret;
 
@@ -58,7 +58,7 @@ void nf_log_unregister_pf(int pf)
 }
 EXPORT_SYMBOL(nf_log_unregister_pf);
 
-void nf_log_unregister(struct nf_logger *logger)
+void nf_log_unregister(const struct nf_logger *logger)
 {
        int i;
 
@@ -78,12 +78,12 @@ void nf_log_packet(int pf,
                   const struct sk_buff *skb,
                   const struct net_device *in,
                   const struct net_device *out,
-                  struct nf_loginfo *loginfo,
+                  const struct nf_loginfo *loginfo,
                   const char *fmt, ...)
 {
        va_list args;
        char prefix[NF_LOG_PREFIXLEN];
-       struct nf_logger *logger;
+       const struct nf_logger *logger;
 
        rcu_read_lock();
        logger = rcu_dereference(nf_loggers[pf]);
index 959a0cb..02e6357 100644 (file)
@@ -726,7 +726,7 @@ nfulnl_recv_unsupp(struct sock *ctnl, struct sk_buff *skb,
        return -ENOTSUPP;
 }
 
-static struct nf_logger nfulnl_logger = {
+static const struct nf_logger nfulnl_logger = {
        .name   = "nfnetlink_log",
        .logfn  = &nfulnl_log_packet,
        .me     = THIS_MODULE,