Skip to content

Commit 591bb27

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: nf_hook_ops structs can be const
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>
1 parent 5da773a commit 591bb27

18 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎drivers/net/ipvlan/ipvlan_main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct ipvlan_netns {
1515
unsigned int ipvl_nf_hook_refcnt;
1616
};
1717

18-
static struct nf_hook_ops ipvl_nfops[] __read_mostly = {
18+
static const struct nf_hook_ops ipvl_nfops[] = {
1919
{
2020
.hook = ipvlan_nf_input,
2121
.pf = NFPROTO_IPV4,

‎net/bridge/br_netfilter_hooks.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ EXPORT_SYMBOL_GPL(br_netfilter_enable);
887887

888888
/* For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because
889889
* br_dev_queue_push_xmit is called afterwards */
890-
static struct nf_hook_ops br_nf_ops[] __read_mostly = {
890+
static const struct nf_hook_ops br_nf_ops[] = {
891891
{
892892
.hook = br_nf_pre_routing,
893893
.pf = NFPROTO_BRIDGE,

‎net/bridge/netfilter/ebtable_filter.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ebt_out_hook(void *priv, struct sk_buff *skb,
7070
return ebt_do_table(skb, state, state->net->xt.frame_filter);
7171
}
7272

73-
static struct nf_hook_ops ebt_ops_filter[] __read_mostly = {
73+
static const struct nf_hook_ops ebt_ops_filter[] = {
7474
{
7575
.hook = ebt_in_hook,
7676
.pf = NFPROTO_BRIDGE,

‎net/bridge/netfilter/ebtable_nat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ebt_nat_out(void *priv, struct sk_buff *skb,
7070
return ebt_do_table(skb, state, state->net->xt.frame_nat);
7171
}
7272

73-
static struct nf_hook_ops ebt_ops_nat[] __read_mostly = {
73+
static const struct nf_hook_ops ebt_ops_nat[] = {
7474
{
7575
.hook = ebt_nat_out,
7676
.pf = NFPROTO_BRIDGE,

‎net/decnet/netfilter/dn_rtmsg.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static inline void dnrmg_receive_user_skb(struct sk_buff *skb)
115115
RCV_SKB_FAIL(-EINVAL);
116116
}
117117

118-
static struct nf_hook_ops dnrmg_ops __read_mostly = {
118+
static const struct nf_hook_ops dnrmg_ops = {
119119
.hook = dnrmg_hook,
120120
.pf = NFPROTO_DECNET,
121121
.hooknum = NF_DN_ROUTE,

‎net/ipv4/netfilter/ipt_CLUSTERIP.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ arp_mangle(void *priv,
624624
return NF_ACCEPT;
625625
}
626626

627-
static struct nf_hook_ops cip_arp_ops __read_mostly = {
627+
static const struct nf_hook_ops cip_arp_ops = {
628628
.hook = arp_mangle,
629629
.pf = NFPROTO_ARP,
630630
.hooknum = NF_ARP_OUT,

‎net/ipv4/netfilter/ipt_SYNPROXY.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static unsigned int ipv4_synproxy_hook(void *priv,
416416
return NF_ACCEPT;
417417
}
418418

419-
static struct nf_hook_ops ipv4_synproxy_ops[] __read_mostly = {
419+
static const struct nf_hook_ops ipv4_synproxy_ops[] = {
420420
{
421421
.hook = ipv4_synproxy_hook,
422422
.pf = NFPROTO_IPV4,

‎net/ipv4/netfilter/iptable_nat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static unsigned int iptable_nat_ipv4_local_fn(void *priv,
6767
return nf_nat_ipv4_local_fn(priv, skb, state, iptable_nat_do_chain);
6868
}
6969

70-
static struct nf_hook_ops nf_nat_ipv4_ops[] __read_mostly = {
70+
static const struct nf_hook_ops nf_nat_ipv4_ops[] = {
7171
/* Before packet filtering, change destination */
7272
{
7373
.hook = iptable_nat_ipv4_in,

‎net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static unsigned int ipv4_conntrack_local(void *priv,
174174

175175
/* Connection tracking may drop packets, but never alters them, so
176176
make it the first hook. */
177-
static struct nf_hook_ops ipv4_conntrack_ops[] __read_mostly = {
177+
static const struct nf_hook_ops ipv4_conntrack_ops[] = {
178178
{
179179
.hook = ipv4_conntrack_in,
180180
.pf = NFPROTO_IPV4,

‎net/ipv4/netfilter/nf_defrag_ipv4.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static unsigned int ipv4_conntrack_defrag(void *priv,
9090
return NF_ACCEPT;
9191
}
9292

93-
static struct nf_hook_ops ipv4_defrag_ops[] = {
93+
static const struct nf_hook_ops ipv4_defrag_ops[] = {
9494
{
9595
.hook = ipv4_conntrack_defrag,
9696
.pf = NFPROTO_IPV4,

0 commit comments

Comments
 (0)