netfilter: conntrack: mark extension structs as const
authorFlorian Westphal <fw@strlen.de>
Thu, 20 Apr 2017 07:54:23 +0000 (09:54 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 26 Apr 2017 07:30:22 +0000 (09:30 +0200)
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_conntrack_extend.h
net/netfilter/nf_conntrack_acct.c
net/netfilter/nf_conntrack_ecache.c
net/netfilter/nf_conntrack_extend.c
net/netfilter/nf_conntrack_helper.c
net/netfilter/nf_conntrack_labels.c
net/netfilter/nf_conntrack_seqadj.c
net/netfilter/nf_conntrack_timeout.c
net/netfilter/nf_conntrack_timestamp.c

index dd776bf..b01f73f 100644 (file)
@@ -99,6 +99,6 @@ struct nf_ct_ext_type {
        u8 align;
 };
 
-int nf_ct_extend_register(struct nf_ct_ext_type *type);
-void nf_ct_extend_unregister(struct nf_ct_ext_type *type);
+int nf_ct_extend_register(const struct nf_ct_ext_type *type);
+void nf_ct_extend_unregister(const struct nf_ct_ext_type *type);
 #endif /* _NF_CONNTRACK_EXTEND_H */
index 45da11a..8669167 100644 (file)
@@ -55,7 +55,7 @@ seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir)
 };
 EXPORT_SYMBOL_GPL(seq_print_acct);
 
-static struct nf_ct_ext_type acct_extend __read_mostly = {
+static const struct nf_ct_ext_type acct_extend = {
        .len    = sizeof(struct nf_conn_acct),
        .align  = __alignof__(struct nf_conn_acct),
        .id     = NF_CT_EXT_ACCT,
index 5152129..caac41a 100644 (file)
@@ -347,7 +347,7 @@ static struct ctl_table event_sysctl_table[] = {
 };
 #endif /* CONFIG_SYSCTL */
 
-static struct nf_ct_ext_type event_extend __read_mostly = {
+static const struct nf_ct_ext_type event_extend = {
        .len    = sizeof(struct nf_conntrack_ecache),
        .align  = __alignof__(struct nf_conntrack_ecache),
        .id     = NF_CT_EXT_ECACHE,
index 2e4b41b..5c66816 100644 (file)
@@ -116,7 +116,7 @@ void *nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
 EXPORT_SYMBOL(nf_ct_ext_add);
 
 /* This MUST be called in process context. */
-int nf_ct_extend_register(struct nf_ct_ext_type *type)
+int nf_ct_extend_register(const struct nf_ct_ext_type *type)
 {
        int ret = 0;
 
@@ -134,7 +134,7 @@ out:
 EXPORT_SYMBOL_GPL(nf_ct_extend_register);
 
 /* This MUST be called in process context. */
-void nf_ct_extend_unregister(struct nf_ct_ext_type *type)
+void nf_ct_extend_unregister(const struct nf_ct_ext_type *type)
 {
        mutex_lock(&nf_ct_ext_type_mutex);
        RCU_INIT_POINTER(nf_ct_ext_types[type->id], NULL);
index 8239b44..a57a52f 100644 (file)
@@ -535,7 +535,7 @@ void nf_conntrack_helpers_unregister(struct nf_conntrack_helper *helper,
 }
 EXPORT_SYMBOL_GPL(nf_conntrack_helpers_unregister);
 
-static struct nf_ct_ext_type helper_extend __read_mostly = {
+static const struct nf_ct_ext_type helper_extend = {
        .len    = sizeof(struct nf_conn_help),
        .align  = __alignof__(struct nf_conn_help),
        .id     = NF_CT_EXT_HELPER,
index bcab8bd..adf2198 100644 (file)
@@ -82,7 +82,7 @@ void nf_connlabels_put(struct net *net)
 }
 EXPORT_SYMBOL_GPL(nf_connlabels_put);
 
-static struct nf_ct_ext_type labels_extend __read_mostly = {
+static const struct nf_ct_ext_type labels_extend = {
        .len    = sizeof(struct nf_conn_labels),
        .align  = __alignof__(struct nf_conn_labels),
        .id     = NF_CT_EXT_LABELS,
index ef7063e..a975efd 100644 (file)
@@ -231,7 +231,7 @@ s32 nf_ct_seq_offset(const struct nf_conn *ct,
 }
 EXPORT_SYMBOL_GPL(nf_ct_seq_offset);
 
-static struct nf_ct_ext_type nf_ct_seqadj_extend __read_mostly = {
+static const struct nf_ct_ext_type nf_ct_seqadj_extend = {
        .len    = sizeof(struct nf_conn_seqadj),
        .align  = __alignof__(struct nf_conn_seqadj),
        .id     = NF_CT_EXT_SEQADJ,
index 26e7420..46aee65 100644 (file)
@@ -31,7 +31,7 @@ EXPORT_SYMBOL_GPL(nf_ct_timeout_find_get_hook);
 void (*nf_ct_timeout_put_hook)(struct ctnl_timeout *timeout) __read_mostly;
 EXPORT_SYMBOL_GPL(nf_ct_timeout_put_hook);
 
-static struct nf_ct_ext_type timeout_extend __read_mostly = {
+static const struct nf_ct_ext_type timeout_extend = {
        .len    = sizeof(struct nf_conn_timeout),
        .align  = __alignof__(struct nf_conn_timeout),
        .id     = NF_CT_EXT_TIMEOUT,
index 7a394df..4c4734b 100644 (file)
@@ -33,7 +33,7 @@ static struct ctl_table tstamp_sysctl_table[] = {
 };
 #endif /* CONFIG_SYSCTL */
 
-static struct nf_ct_ext_type tstamp_extend __read_mostly = {
+static const struct nf_ct_ext_type tstamp_extend = {
        .len    = sizeof(struct nf_conn_tstamp),
        .align  = __alignof__(struct nf_conn_tstamp),
        .id     = NF_CT_EXT_TSTAMP,