diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h index f0426e59f2295dfda83115be1d6cafb702d119ba..037e82403f916244926973a4e7c2c35774fea00e 100644 --- a/include/net/netfilter/nf_log.h +++ b/include/net/netfilter/nf_log.h @@ -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 */ diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index fcb3b54dc191fd5af004f27a3fa14009d2a60299..3be9e9898553b1d129700929dac0177853c0b377 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c @@ -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, diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index 1b9ca07f44ffbabbb7a7dc3238b007397e4fcd9d..b73ba28bcbe85e3c79a842f0ec2d65b80064d2ba 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c @@ -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, diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index 4b346e59bf2db64c024f9ccda2cb6f9ec61221e8..5acdddfa6add9dfeff483ca945c27be56d20e61d 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c @@ -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, diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index e6a2b1e9469cccfb34f65332e41d291754551bb3..474c2b12621ad489eb7391b22ac9e883e011ced7 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c @@ -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, diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index fad97d69481c227fab6286021c05c5ffa1322103..ed9116dc78b5ea7a9d3e067cbae287eef84e9598 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c @@ -15,12 +15,12 @@ #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]); diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 959a0cb131f1f61c4390c74cc57d0bab62ff3ef3..02e63577e156a600a81fec20ad1f5ae42b4b7b59 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -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,