netfilter: nf_hook_ops structs can be const
authorFlorian Westphal <fw@strlen.de>
Wed, 26 Jul 2017 09:40:52 +0000 (11:40 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 31 Jul 2017 17:10:44 +0000 (19:10 +0200)
We no longer place these on a list so they can be const.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
18 files changed:
drivers/net/ipvlan/ipvlan_main.c
net/bridge/br_netfilter_hooks.c
net/bridge/netfilter/ebtable_filter.c
net/bridge/netfilter/ebtable_nat.c
net/decnet/netfilter/dn_rtmsg.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_SYNPROXY.c
net/ipv4/netfilter/iptable_nat.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv4/netfilter/nf_defrag_ipv4.c
net/ipv6/ila/ila_xlat.c
net/ipv6/netfilter/ip6t_SYNPROXY.c
net/ipv6/netfilter/ip6table_nat.c
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
net/netfilter/ipvs/ip_vs_core.c
security/selinux/hooks.c
security/smack/smack_netfilter.c

index fdde20735416963cf772451b0e41e95e0c2bc7b8..943e6907dc19e9e596819c851897255d495d7f2b 100644 (file)
@@ -15,7 +15,7 @@ struct ipvlan_netns {
        unsigned int ipvl_nf_hook_refcnt;
 };
 
-static struct nf_hook_ops ipvl_nfops[] __read_mostly = {
+static const struct nf_hook_ops ipvl_nfops[] = {
        {
                .hook     = ipvlan_nf_input,
                .pf       = NFPROTO_IPV4,
index 2261e5194c82cf72cfce944de61eb263b4375157..626f4b2cef1648001baea80b5ba3afc3b8b801ea 100644 (file)
@@ -887,7 +887,7 @@ EXPORT_SYMBOL_GPL(br_netfilter_enable);
 
 /* For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because
  * br_dev_queue_push_xmit is called afterwards */
-static struct nf_hook_ops br_nf_ops[] __read_mostly = {
+static const struct nf_hook_ops br_nf_ops[] = {
        {
                .hook = br_nf_pre_routing,
                .pf = NFPROTO_BRIDGE,
index f22ef7c219137231e13e756b2695b281b90b9dd8..45a00dbdbcad647f2342caa9fc9181f27b7f3a77 100644 (file)
@@ -70,7 +70,7 @@ ebt_out_hook(void *priv, struct sk_buff *skb,
        return ebt_do_table(skb, state, state->net->xt.frame_filter);
 }
 
-static struct nf_hook_ops ebt_ops_filter[] __read_mostly = {
+static const struct nf_hook_ops ebt_ops_filter[] = {
        {
                .hook           = ebt_in_hook,
                .pf             = NFPROTO_BRIDGE,
index 2f7a4f314406382a655a94d2ce384226ab906bfb..4ecf50662b7d8c3529158d73207b7e3c4cbd8296 100644 (file)
@@ -70,7 +70,7 @@ ebt_nat_out(void *priv, struct sk_buff *skb,
        return ebt_do_table(skb, state, state->net->xt.frame_nat);
 }
 
-static struct nf_hook_ops ebt_ops_nat[] __read_mostly = {
+static const struct nf_hook_ops ebt_ops_nat[] = {
        {
                .hook           = ebt_nat_out,
                .pf             = NFPROTO_BRIDGE,
index aa8ffecc46a439fa129dfea9c1f4d4e525ad3796..ab395e55cd7895691682548b4c042dfbc3a7b127 100644 (file)
@@ -115,7 +115,7 @@ static inline void dnrmg_receive_user_skb(struct sk_buff *skb)
        RCV_SKB_FAIL(-EINVAL);
 }
 
-static struct nf_hook_ops dnrmg_ops __read_mostly = {
+static const struct nf_hook_ops dnrmg_ops = {
        .hook           = dnrmg_hook,
        .pf             = NFPROTO_DECNET,
        .hooknum        = NF_DN_ROUTE,
index 7d72decb80f9f9c4150bd2a42c4b802ba1fd7f17..6637e8b37ee2292d54693b516b6d64a5d48a88ab 100644 (file)
@@ -624,7 +624,7 @@ arp_mangle(void *priv,
        return NF_ACCEPT;
 }
 
-static struct nf_hook_ops cip_arp_ops __read_mostly = {
+static const struct nf_hook_ops cip_arp_ops = {
        .hook = arp_mangle,
        .pf = NFPROTO_ARP,
        .hooknum = NF_ARP_OUT,
index f1528f7175a8c18697cb4b5da776acc670076e49..811689e523c310dc41b71f6ec9fcff3d2749e590 100644 (file)
@@ -416,7 +416,7 @@ static unsigned int ipv4_synproxy_hook(void *priv,
        return NF_ACCEPT;
 }
 
-static struct nf_hook_ops ipv4_synproxy_ops[] __read_mostly = {
+static const struct nf_hook_ops ipv4_synproxy_ops[] = {
        {
                .hook           = ipv4_synproxy_hook,
                .pf             = NFPROTO_IPV4,
index 138a24bc76ad9d215e1e9b836405774adaac02e7..a1a07b338ccfd5468b4fe80557af693b0e4f8861 100644 (file)
@@ -67,7 +67,7 @@ static unsigned int iptable_nat_ipv4_local_fn(void *priv,
        return nf_nat_ipv4_local_fn(priv, skb, state, iptable_nat_do_chain);
 }
 
-static struct nf_hook_ops nf_nat_ipv4_ops[] __read_mostly = {
+static const struct nf_hook_ops nf_nat_ipv4_ops[] = {
        /* Before packet filtering, change destination */
        {
                .hook           = iptable_nat_ipv4_in,
index 2e14ed11a35cfc83db845e972521b2e8894f97c6..63e4ea0e01f8780586722ca3371506fa6e2fd019 100644 (file)
@@ -174,7 +174,7 @@ static unsigned int ipv4_conntrack_local(void *priv,
 
 /* Connection tracking may drop packets, but never alters them, so
    make it the first hook. */
-static struct nf_hook_ops ipv4_conntrack_ops[] __read_mostly = {
+static const struct nf_hook_ops ipv4_conntrack_ops[] = {
        {
                .hook           = ipv4_conntrack_in,
                .pf             = NFPROTO_IPV4,
index 346bf7ccac0881bc86c7d019987281d9dc8db62e..37fe1616ca0bcb27ca2a4772dc93851d00b7929a 100644 (file)
@@ -90,7 +90,7 @@ static unsigned int ipv4_conntrack_defrag(void *priv,
        return NF_ACCEPT;
 }
 
-static struct nf_hook_ops ipv4_defrag_ops[] = {
+static const struct nf_hook_ops ipv4_defrag_ops[] = {
        {
                .hook           = ipv4_conntrack_defrag,
                .pf             = NFPROTO_IPV4,
index 77f7f8c7d93d67483f241616123380f9d8e6ba84..5bd419c1abc8b7ba3c564eb33ff6611dabcb47fb 100644 (file)
@@ -208,7 +208,7 @@ ila_nf_input(void *priv,
        return NF_ACCEPT;
 }
 
-static struct nf_hook_ops ila_nf_hook_ops[] __read_mostly = {
+static const struct nf_hook_ops ila_nf_hook_ops[] = {
        {
                .hook = ila_nf_input,
                .pf = NFPROTO_IPV6,
index ce203dd729e0686af769c1b9e4997286d00e01d4..a5cd43d75393db2152fa5a4edb0b505d20fc2f45 100644 (file)
@@ -438,7 +438,7 @@ static unsigned int ipv6_synproxy_hook(void *priv,
        return NF_ACCEPT;
 }
 
-static struct nf_hook_ops ipv6_synproxy_ops[] __read_mostly = {
+static const struct nf_hook_ops ipv6_synproxy_ops[] = {
        {
                .hook           = ipv6_synproxy_hook,
                .pf             = NFPROTO_IPV6,
index 7d2bd940291fd47a68977ec86b7ac0952744c432..991512576c8c8601b54a41d4c7f417500fa5f53d 100644 (file)
@@ -69,7 +69,7 @@ static unsigned int ip6table_nat_local_fn(void *priv,
        return nf_nat_ipv6_local_fn(priv, skb, state, ip6table_nat_do_chain);
 }
 
-static struct nf_hook_ops nf_nat_ipv6_ops[] __read_mostly = {
+static const struct nf_hook_ops nf_nat_ipv6_ops[] = {
        /* Before packet filtering, change destination */
        {
                .hook           = ip6table_nat_in,
index 4e34024868334427194992d8033d0d58a0361d3b..f2d2f4a9294b74413fc92c58ca52ab15af3dbd58 100644 (file)
@@ -191,7 +191,7 @@ static unsigned int ipv6_conntrack_local(void *priv,
        return nf_conntrack_in(state->net, PF_INET6, state->hook, skb);
 }
 
-static struct nf_hook_ops ipv6_conntrack_ops[] __read_mostly = {
+static const struct nf_hook_ops ipv6_conntrack_ops[] = {
        {
                .hook           = ipv6_conntrack_in,
                .pf             = NFPROTO_IPV6,
index ada60d1a991b7c2e421884f0a8c4361d6f81f10a..b326da59257f60396cda3daddfd643a3cec262a5 100644 (file)
@@ -74,7 +74,7 @@ static unsigned int ipv6_defrag(void *priv,
        return err == 0 ? NF_ACCEPT : NF_DROP;
 }
 
-static struct nf_hook_ops ipv6_defrag_ops[] = {
+static const struct nf_hook_ops ipv6_defrag_ops[] = {
        {
                .hook           = ipv6_defrag,
                .pf             = NFPROTO_IPV6,
index 2ff9d9070c95508f193b3daf458349abe3dc1b6a..5cb7cac9177d8bb2b2a37e887aed7a8b7378980c 100644 (file)
@@ -2101,7 +2101,7 @@ ip_vs_forward_icmp_v6(void *priv, struct sk_buff *skb,
 #endif
 
 
-static struct nf_hook_ops ip_vs_ops[] __read_mostly = {
+static const struct nf_hook_ops ip_vs_ops[] = {
        /* After packet filtering, change source only for VS/NAT */
        {
                .hook           = ip_vs_reply4,
index 33fd061305c40376c7f632ebcdf6fe5fd7b1e3fc..2f2e1338cd3d7e320784ba8cd45d2fb023ae1586 100644 (file)
@@ -6530,7 +6530,7 @@ security_initcall(selinux_init);
 
 #if defined(CONFIG_NETFILTER)
 
-static struct nf_hook_ops selinux_nf_ops[] = {
+static const struct nf_hook_ops selinux_nf_ops[] = {
        {
                .hook =         selinux_ipv4_postroute,
                .pf =           NFPROTO_IPV4,
index cdeb0f3243dd635ced5e9efb49fb3fb61d37e4f3..e36d17835d4ff3dffff8bb42ed3e50bb7e1af571 100644 (file)
@@ -58,7 +58,7 @@ static unsigned int smack_ipv4_output(void *priv,
        return NF_ACCEPT;
 }
 
-static struct nf_hook_ops smack_nf_ops[] = {
+static const struct nf_hook_ops smack_nf_ops[] = {
        {
                .hook =         smack_ipv4_output,
                .pf =           NFPROTO_IPV4,