Commit 9dae47ab authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso

netfilter: conntrack: l4 protocol trackers can be const

previous patches removed all writes to these structs so we can
now mark them as const.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent cd9ceafc
...@@ -13,17 +13,17 @@ ...@@ -13,17 +13,17 @@
const extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; const extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;
#ifdef CONFIG_NF_CT_PROTO_DCCP #ifdef CONFIG_NF_CT_PROTO_DCCP
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4;
#endif #endif
#ifdef CONFIG_NF_CT_PROTO_SCTP #ifdef CONFIG_NF_CT_PROTO_SCTP
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4;
#endif #endif
#ifdef CONFIG_NF_CT_PROTO_UDPLITE #ifdef CONFIG_NF_CT_PROTO_UDPLITE
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4;
#endif #endif
int nf_conntrack_ipv4_compat_init(void); int nf_conntrack_ipv4_compat_init(void);
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
extern const struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; extern const struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6;
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6;
#ifdef CONFIG_NF_CT_PROTO_DCCP #ifdef CONFIG_NF_CT_PROTO_DCCP
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp6; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp6;
#endif #endif
#ifdef CONFIG_NF_CT_PROTO_SCTP #ifdef CONFIG_NF_CT_PROTO_SCTP
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6;
#endif #endif
#ifdef CONFIG_NF_CT_PROTO_UDPLITE #ifdef CONFIG_NF_CT_PROTO_UDPLITE
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6;
#endif #endif
#include <linux/sysctl.h> #include <linux/sysctl.h>
......
...@@ -108,7 +108,7 @@ struct nf_conntrack_l4proto { ...@@ -108,7 +108,7 @@ struct nf_conntrack_l4proto {
}; };
/* Existing built-in generic protocol */ /* Existing built-in generic protocol */
extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; extern const struct nf_conntrack_l4proto nf_conntrack_l4proto_generic;
#define MAX_NF_CT_PROTO 256 #define MAX_NF_CT_PROTO 256
......
...@@ -351,7 +351,7 @@ static struct nf_proto_net *icmp_get_net_proto(struct net *net) ...@@ -351,7 +351,7 @@ static struct nf_proto_net *icmp_get_net_proto(struct net *net)
return &net->ct.nf_ct_proto.icmp.pn; return &net->ct.nf_ct_proto.icmp.pn;
} }
struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp =
{ {
.l3proto = PF_INET, .l3proto = PF_INET,
.l4proto = IPPROTO_ICMP, .l4proto = IPPROTO_ICMP,
......
...@@ -352,7 +352,7 @@ static struct nf_proto_net *icmpv6_get_net_proto(struct net *net) ...@@ -352,7 +352,7 @@ static struct nf_proto_net *icmpv6_get_net_proto(struct net *net)
return &net->ct.nf_ct_proto.icmpv6.pn; return &net->ct.nf_ct_proto.icmpv6.pn;
} }
struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 =
{ {
.l3proto = PF_INET6, .l3proto = PF_INET6,
.l4proto = IPPROTO_ICMPV6, .l4proto = IPPROTO_ICMPV6,
......
...@@ -861,7 +861,7 @@ static struct nf_proto_net *dccp_get_net_proto(struct net *net) ...@@ -861,7 +861,7 @@ static struct nf_proto_net *dccp_get_net_proto(struct net *net)
return &net->ct.nf_ct_proto.dccp.pn; return &net->ct.nf_ct_proto.dccp.pn;
} }
struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4 __read_mostly = { const struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4 = {
.l3proto = AF_INET, .l3proto = AF_INET,
.l4proto = IPPROTO_DCCP, .l4proto = IPPROTO_DCCP,
.pkt_to_tuple = dccp_pkt_to_tuple, .pkt_to_tuple = dccp_pkt_to_tuple,
...@@ -897,7 +897,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4 __read_mostly = { ...@@ -897,7 +897,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4 __read_mostly = {
}; };
EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_dccp4); EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_dccp4);
struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp6 __read_mostly = { const struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp6 = {
.l3proto = AF_INET6, .l3proto = AF_INET6,
.l4proto = IPPROTO_DCCP, .l4proto = IPPROTO_DCCP,
.pkt_to_tuple = dccp_pkt_to_tuple, .pkt_to_tuple = dccp_pkt_to_tuple,
......
...@@ -163,7 +163,7 @@ static struct nf_proto_net *generic_get_net_proto(struct net *net) ...@@ -163,7 +163,7 @@ static struct nf_proto_net *generic_get_net_proto(struct net *net)
return &net->ct.nf_ct_proto.generic.pn; return &net->ct.nf_ct_proto.generic.pn;
} }
struct nf_conntrack_l4proto nf_conntrack_l4proto_generic __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_generic =
{ {
.l3proto = PF_UNSPEC, .l3proto = PF_UNSPEC,
.l4proto = 255, .l4proto = 255,
......
...@@ -352,7 +352,7 @@ static int gre_init_net(struct net *net, u_int16_t proto) ...@@ -352,7 +352,7 @@ static int gre_init_net(struct net *net, u_int16_t proto)
} }
/* protocol helper struct */ /* protocol helper struct */
static struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 __read_mostly = { static const struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 = {
.l3proto = AF_INET, .l3proto = AF_INET,
.l4proto = IPPROTO_GRE, .l4proto = IPPROTO_GRE,
.pkt_to_tuple = gre_pkt_to_tuple, .pkt_to_tuple = gre_pkt_to_tuple,
......
...@@ -777,7 +777,7 @@ static struct nf_proto_net *sctp_get_net_proto(struct net *net) ...@@ -777,7 +777,7 @@ static struct nf_proto_net *sctp_get_net_proto(struct net *net)
return &net->ct.nf_ct_proto.sctp.pn; return &net->ct.nf_ct_proto.sctp.pn;
} }
struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4 __read_mostly = { const struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4 = {
.l3proto = PF_INET, .l3proto = PF_INET,
.l4proto = IPPROTO_SCTP, .l4proto = IPPROTO_SCTP,
.pkt_to_tuple = sctp_pkt_to_tuple, .pkt_to_tuple = sctp_pkt_to_tuple,
...@@ -814,7 +814,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4 __read_mostly = { ...@@ -814,7 +814,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4 __read_mostly = {
}; };
EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_sctp4); EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_sctp4);
struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6 __read_mostly = { const struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6 = {
.l3proto = PF_INET6, .l3proto = PF_INET6,
.l4proto = IPPROTO_SCTP, .l4proto = IPPROTO_SCTP,
.pkt_to_tuple = sctp_pkt_to_tuple, .pkt_to_tuple = sctp_pkt_to_tuple,
......
...@@ -1541,7 +1541,7 @@ static struct nf_proto_net *tcp_get_net_proto(struct net *net) ...@@ -1541,7 +1541,7 @@ static struct nf_proto_net *tcp_get_net_proto(struct net *net)
return &net->ct.nf_ct_proto.tcp.pn; return &net->ct.nf_ct_proto.tcp.pn;
} }
struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 =
{ {
.l3proto = PF_INET, .l3proto = PF_INET,
.l4proto = IPPROTO_TCP, .l4proto = IPPROTO_TCP,
...@@ -1579,7 +1579,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 __read_mostly = ...@@ -1579,7 +1579,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 __read_mostly =
}; };
EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_tcp4); EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_tcp4);
struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6 __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6 =
{ {
.l3proto = PF_INET6, .l3proto = PF_INET6,
.l4proto = IPPROTO_TCP, .l4proto = IPPROTO_TCP,
......
...@@ -296,7 +296,7 @@ static struct nf_proto_net *udp_get_net_proto(struct net *net) ...@@ -296,7 +296,7 @@ static struct nf_proto_net *udp_get_net_proto(struct net *net)
return &net->ct.nf_ct_proto.udp.pn; return &net->ct.nf_ct_proto.udp.pn;
} }
struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 =
{ {
.l3proto = PF_INET, .l3proto = PF_INET,
.l4proto = IPPROTO_UDP, .l4proto = IPPROTO_UDP,
...@@ -328,7 +328,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly = ...@@ -328,7 +328,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly =
EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udp4); EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udp4);
#ifdef CONFIG_NF_CT_PROTO_UDPLITE #ifdef CONFIG_NF_CT_PROTO_UDPLITE
struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 =
{ {
.l3proto = PF_INET, .l3proto = PF_INET,
.l4proto = IPPROTO_UDPLITE, .l4proto = IPPROTO_UDPLITE,
...@@ -360,7 +360,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly = ...@@ -360,7 +360,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly =
EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udplite4); EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udplite4);
#endif #endif
struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 =
{ {
.l3proto = PF_INET6, .l3proto = PF_INET6,
.l4proto = IPPROTO_UDP, .l4proto = IPPROTO_UDP,
...@@ -392,7 +392,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly = ...@@ -392,7 +392,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly =
EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udp6); EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udp6);
#ifdef CONFIG_NF_CT_PROTO_UDPLITE #ifdef CONFIG_NF_CT_PROTO_UDPLITE
struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6 __read_mostly = const struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6 =
{ {
.l3proto = PF_INET6, .l3proto = PF_INET6,
.l4proto = IPPROTO_UDPLITE, .l4proto = IPPROTO_UDPLITE,
......
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