Commit 1999414a authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: Mark hooks __read_mostly

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41c5b317
...@@ -871,7 +871,7 @@ static unsigned int ip_sabotage_in(unsigned int hook, struct sk_buff *skb, ...@@ -871,7 +871,7 @@ static unsigned int ip_sabotage_in(unsigned int hook, struct sk_buff *skb,
* PF_BRIDGE/NF_BR_LOCAL_OUT functions don't get bridged traffic as input. * PF_BRIDGE/NF_BR_LOCAL_OUT functions don't get bridged traffic as input.
* For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because * For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because
* ip_refrag() can return NF_STOLEN. */ * ip_refrag() can return NF_STOLEN. */
static struct nf_hook_ops br_nf_ops[] = { static struct nf_hook_ops br_nf_ops[] __read_mostly = {
{ .hook = br_nf_pre_routing, { .hook = br_nf_pre_routing,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pf = PF_BRIDGE, .pf = PF_BRIDGE,
......
...@@ -67,7 +67,7 @@ ebt_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, ...@@ -67,7 +67,7 @@ ebt_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in,
return ebt_do_table(hook, skb, in, out, &frame_filter); return ebt_do_table(hook, skb, in, out, &frame_filter);
} }
static struct nf_hook_ops ebt_ops_filter[] = { static struct nf_hook_ops ebt_ops_filter[] __read_mostly = {
{ {
.hook = ebt_hook, .hook = ebt_hook,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -74,7 +74,7 @@ ebt_nat_src(unsigned int hook, struct sk_buff *skb, const struct net_device *in ...@@ -74,7 +74,7 @@ ebt_nat_src(unsigned int hook, struct sk_buff *skb, const struct net_device *in
return ebt_do_table(hook, skb, in, out, &frame_nat); return ebt_do_table(hook, skb, in, out, &frame_nat);
} }
static struct nf_hook_ops ebt_ops_nat[] = { static struct nf_hook_ops ebt_ops_nat[] __read_mostly = {
{ {
.hook = ebt_nat_dst, .hook = ebt_nat_dst,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -115,7 +115,7 @@ static inline void dnrmg_receive_user_skb(struct sk_buff *skb) ...@@ -115,7 +115,7 @@ static inline void dnrmg_receive_user_skb(struct sk_buff *skb)
RCV_SKB_FAIL(-EINVAL); RCV_SKB_FAIL(-EINVAL);
} }
static struct nf_hook_ops dnrmg_ops = { static struct nf_hook_ops dnrmg_ops __read_mostly = {
.hook = dnrmg_hook, .hook = dnrmg_hook,
.pf = PF_DECnet, .pf = PF_DECnet,
.hooknum = NF_DN_ROUTE, .hooknum = NF_DN_ROUTE,
......
...@@ -1025,7 +1025,7 @@ ip_vs_forward_icmp(unsigned int hooknum, struct sk_buff *skb, ...@@ -1025,7 +1025,7 @@ ip_vs_forward_icmp(unsigned int hooknum, struct sk_buff *skb,
} }
static struct nf_hook_ops ip_vs_ops[] = { static struct nf_hook_ops ip_vs_ops[] __read_mostly = {
/* After packet filtering, forward packet through VS/DR, VS/TUN, /* After packet filtering, forward packet through VS/DR, VS/TUN,
* or VS/NAT(change destination), so that filtering rules can be * or VS/NAT(change destination), so that filtering rules can be
* applied to IPVS. */ * applied to IPVS. */
......
...@@ -64,7 +64,7 @@ static unsigned int arpt_hook(unsigned int hook, ...@@ -64,7 +64,7 @@ static unsigned int arpt_hook(unsigned int hook,
return arpt_do_table(skb, hook, in, out, &packet_filter); return arpt_do_table(skb, hook, in, out, &packet_filter);
} }
static struct nf_hook_ops arpt_ops[] = { static struct nf_hook_ops arpt_ops[] __read_mostly = {
{ {
.hook = arpt_hook, .hook = arpt_hook,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -551,7 +551,7 @@ arp_mangle(unsigned int hook, ...@@ -551,7 +551,7 @@ arp_mangle(unsigned int hook,
return NF_ACCEPT; return NF_ACCEPT;
} }
static struct nf_hook_ops cip_arp_ops = { static struct nf_hook_ops cip_arp_ops __read_mostly = {
.hook = arp_mangle, .hook = arp_mangle,
.pf = NF_ARP, .pf = NF_ARP,
.hooknum = NF_ARP_OUT, .hooknum = NF_ARP_OUT,
......
...@@ -91,7 +91,7 @@ ipt_local_out_hook(unsigned int hook, ...@@ -91,7 +91,7 @@ ipt_local_out_hook(unsigned int hook,
return ipt_do_table(skb, hook, in, out, &packet_filter); return ipt_do_table(skb, hook, in, out, &packet_filter);
} }
static struct nf_hook_ops ipt_ops[] = { static struct nf_hook_ops ipt_ops[] __read_mostly = {
{ {
.hook = ipt_hook, .hook = ipt_hook,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -128,7 +128,7 @@ ipt_local_hook(unsigned int hook, ...@@ -128,7 +128,7 @@ ipt_local_hook(unsigned int hook,
return ret; return ret;
} }
static struct nf_hook_ops ipt_ops[] = { static struct nf_hook_ops ipt_ops[] __read_mostly = {
{ {
.hook = ipt_route_hook, .hook = ipt_route_hook,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -74,7 +74,7 @@ ipt_local_hook(unsigned int hook, ...@@ -74,7 +74,7 @@ ipt_local_hook(unsigned int hook,
} }
/* 'raw' is the very first table. */ /* 'raw' is the very first table. */
static struct nf_hook_ops ipt_ops[] = { static struct nf_hook_ops ipt_ops[] __read_mostly = {
{ {
.hook = ipt_hook, .hook = ipt_hook,
.pf = PF_INET, .pf = PF_INET,
......
...@@ -185,7 +185,7 @@ static unsigned int ipv4_conntrack_local(unsigned int hooknum, ...@@ -185,7 +185,7 @@ static unsigned int ipv4_conntrack_local(unsigned int hooknum,
/* Connection tracking may drop packets, but never alters them, so /* Connection tracking may drop packets, but never alters them, so
make it the first hook. */ make it the first hook. */
static struct nf_hook_ops ipv4_conntrack_ops[] = { static struct nf_hook_ops ipv4_conntrack_ops[] __read_mostly = {
{ {
.hook = ipv4_conntrack_defrag, .hook = ipv4_conntrack_defrag,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -273,7 +273,7 @@ nf_nat_adjust(unsigned int hooknum, ...@@ -273,7 +273,7 @@ nf_nat_adjust(unsigned int hooknum,
/* We must be after connection tracking and before packet filtering. */ /* We must be after connection tracking and before packet filtering. */
static struct nf_hook_ops nf_nat_ops[] = { static struct nf_hook_ops nf_nat_ops[] __read_mostly = {
/* Before packet filtering, change destination */ /* Before packet filtering, change destination */
{ {
.hook = nf_nat_in, .hook = nf_nat_in,
......
...@@ -90,7 +90,7 @@ ip6t_local_out_hook(unsigned int hook, ...@@ -90,7 +90,7 @@ ip6t_local_out_hook(unsigned int hook,
return ip6t_do_table(skb, hook, in, out, &packet_filter); return ip6t_do_table(skb, hook, in, out, &packet_filter);
} }
static struct nf_hook_ops ip6t_ops[] = { static struct nf_hook_ops ip6t_ops[] __read_mostly = {
{ {
.hook = ip6t_hook, .hook = ip6t_hook,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -120,7 +120,7 @@ ip6t_local_hook(unsigned int hook, ...@@ -120,7 +120,7 @@ ip6t_local_hook(unsigned int hook,
return ret; return ret;
} }
static struct nf_hook_ops ip6t_ops[] = { static struct nf_hook_ops ip6t_ops[] __read_mostly = {
{ {
.hook = ip6t_route_hook, .hook = ip6t_route_hook,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -54,7 +54,7 @@ ip6t_hook(unsigned int hook, ...@@ -54,7 +54,7 @@ ip6t_hook(unsigned int hook,
return ip6t_do_table(skb, hook, in, out, &packet_raw); return ip6t_do_table(skb, hook, in, out, &packet_raw);
} }
static struct nf_hook_ops ip6t_ops[] = { static struct nf_hook_ops ip6t_ops[] __read_mostly = {
{ {
.hook = ip6t_hook, .hook = ip6t_hook,
.pf = PF_INET6, .pf = PF_INET6,
......
...@@ -258,7 +258,7 @@ static unsigned int ipv6_conntrack_local(unsigned int hooknum, ...@@ -258,7 +258,7 @@ static unsigned int ipv6_conntrack_local(unsigned int hooknum,
return ipv6_conntrack_in(hooknum, skb, in, out, okfn); return ipv6_conntrack_in(hooknum, skb, in, out, okfn);
} }
static struct nf_hook_ops ipv6_conntrack_ops[] = { static struct nf_hook_ops ipv6_conntrack_ops[] __read_mostly = {
{ {
.hook = ipv6_defrag, .hook = ipv6_defrag,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -231,7 +231,7 @@ ing_hook(unsigned int hook, struct sk_buff *skb, ...@@ -231,7 +231,7 @@ ing_hook(unsigned int hook, struct sk_buff *skb,
} }
/* after ipt_filter */ /* after ipt_filter */
static struct nf_hook_ops ing_ops[] = { static struct nf_hook_ops ing_ops[] __read_mostly = {
{ {
.hook = ing_hook, .hook = ing_hook,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment