Commit 2c9e8637ea15cf7f060b48f73b79e5055ffa93ad

Authored by Florian Westphal
Committed by Pablo Neira Ayuso
1 parent e8542dcec0

netfilter: conntrack: timeouts can be const

Nowadays this is just the default template that is used when setting up
the net namespace, so nothing writes to these locations.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Showing 7 changed files with 7 additions and 7 deletions Side-by-side Diff

net/ipv4/netfilter/nf_conntrack_proto_icmp.c
... ... @@ -22,7 +22,7 @@
22 22 #include <net/netfilter/nf_conntrack_zones.h>
23 23 #include <net/netfilter/nf_log.h>
24 24  
25   -static unsigned int nf_ct_icmp_timeout __read_mostly = 30*HZ;
  25 +static const unsigned int nf_ct_icmp_timeout = 30*HZ;
26 26  
27 27 static inline struct nf_icmp_net *icmp_pernet(struct net *net)
28 28 {
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
... ... @@ -27,7 +27,7 @@
27 27 #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h>
28 28 #include <net/netfilter/nf_log.h>
29 29  
30   -static unsigned int nf_ct_icmpv6_timeout __read_mostly = 30*HZ;
  30 +static const unsigned int nf_ct_icmpv6_timeout = 30*HZ;
31 31  
32 32 static inline struct nf_icmp_net *icmpv6_pernet(struct net *net)
33 33 {
net/netfilter/nf_conntrack_proto_generic.c
... ... @@ -12,7 +12,7 @@
12 12 #include <linux/netfilter.h>
13 13 #include <net/netfilter/nf_conntrack_l4proto.h>
14 14  
15   -static unsigned int nf_ct_generic_timeout __read_mostly = 600*HZ;
  15 +static const unsigned int nf_ct_generic_timeout = 600*HZ;
16 16  
17 17 static bool nf_generic_should_process(u8 proto)
18 18 {
net/netfilter/nf_conntrack_proto_gre.c
... ... @@ -48,7 +48,7 @@
48 48 GRE_CT_MAX
49 49 };
50 50  
51   -static unsigned int gre_timeouts[GRE_CT_MAX] = {
  51 +static const unsigned int gre_timeouts[GRE_CT_MAX] = {
52 52 [GRE_CT_UNREPLIED] = 30*HZ,
53 53 [GRE_CT_REPLIED] = 180*HZ,
54 54 };
net/netfilter/nf_conntrack_proto_sctp.c
... ... @@ -52,7 +52,7 @@
52 52 #define HOURS * 60 MINS
53 53 #define DAYS * 24 HOURS
54 54  
55   -static unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] __read_mostly = {
  55 +static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = {
56 56 [SCTP_CONNTRACK_CLOSED] = 10 SECS,
57 57 [SCTP_CONNTRACK_COOKIE_WAIT] = 3 SECS,
58 58 [SCTP_CONNTRACK_COOKIE_ECHOED] = 3 SECS,
net/netfilter/nf_conntrack_proto_tcp.c
... ... @@ -68,7 +68,7 @@
68 68 #define HOURS * 60 MINS
69 69 #define DAYS * 24 HOURS
70 70  
71   -static unsigned int tcp_timeouts[TCP_CONNTRACK_TIMEOUT_MAX] __read_mostly = {
  71 +static const unsigned int tcp_timeouts[TCP_CONNTRACK_TIMEOUT_MAX] = {
72 72 [TCP_CONNTRACK_SYN_SENT] = 2 MINS,
73 73 [TCP_CONNTRACK_SYN_RECV] = 60 SECS,
74 74 [TCP_CONNTRACK_ESTABLISHED] = 5 DAYS,
net/netfilter/nf_conntrack_proto_udp.c
... ... @@ -26,7 +26,7 @@
26 26 #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
27 27 #include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
28 28  
29   -static unsigned int udp_timeouts[UDP_CT_MAX] = {
  29 +static const unsigned int udp_timeouts[UDP_CT_MAX] = {
30 30 [UDP_CT_UNREPLIED] = 30*HZ,
31 31 [UDP_CT_REPLIED] = 180*HZ,
32 32 };