Commit a8e3bb34 authored by David Ahern's avatar David Ahern Committed by David S. Miller

net: Add comment that early_demux can change via sysctl

Twice patches trying to constify inet{6}_protocol have been reverted:
39294c3d ("Revert "ipv6: constify inet6_protocol structures"") to
revert 3a3a4e30 and then 03157937 ("Revert "ipv4: make
net_protocol const"") to revert aa8db499.

Add a comment that the structures can not be const because the
early_demux field can change based on a sysctl.
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc8737a5
...@@ -1596,6 +1596,9 @@ static const struct net_protocol igmp_protocol = { ...@@ -1596,6 +1596,9 @@ static const struct net_protocol igmp_protocol = {
}; };
#endif #endif
/* thinking of making this const? Don't.
* early_demux can change based on sysctl.
*/
static struct net_protocol tcp_protocol = { static struct net_protocol tcp_protocol = {
.early_demux = tcp_v4_early_demux, .early_demux = tcp_v4_early_demux,
.early_demux_handler = tcp_v4_early_demux, .early_demux_handler = tcp_v4_early_demux,
...@@ -1606,6 +1609,9 @@ static struct net_protocol tcp_protocol = { ...@@ -1606,6 +1609,9 @@ static struct net_protocol tcp_protocol = {
.icmp_strict_tag_validation = 1, .icmp_strict_tag_validation = 1,
}; };
/* thinking of making this const? Don't.
* early_demux can change based on sysctl.
*/
static struct net_protocol udp_protocol = { static struct net_protocol udp_protocol = {
.early_demux = udp_v4_early_demux, .early_demux = udp_v4_early_demux,
.early_demux_handler = udp_v4_early_demux, .early_demux_handler = udp_v4_early_demux,
......
...@@ -1949,6 +1949,9 @@ struct proto tcpv6_prot = { ...@@ -1949,6 +1949,9 @@ struct proto tcpv6_prot = {
.diag_destroy = tcp_abort, .diag_destroy = tcp_abort,
}; };
/* thinking of making this const? Don't.
* early_demux can change based on sysctl.
*/
static struct inet6_protocol tcpv6_protocol = { static struct inet6_protocol tcpv6_protocol = {
.early_demux = tcp_v6_early_demux, .early_demux = tcp_v6_early_demux,
.early_demux_handler = tcp_v6_early_demux, .early_demux_handler = tcp_v6_early_demux,
......
...@@ -1472,6 +1472,9 @@ int compat_udpv6_getsockopt(struct sock *sk, int level, int optname, ...@@ -1472,6 +1472,9 @@ int compat_udpv6_getsockopt(struct sock *sk, int level, int optname,
} }
#endif #endif
/* thinking of making this const? Don't.
* early_demux can change based on sysctl.
*/
static struct inet6_protocol udpv6_protocol = { static struct inet6_protocol udpv6_protocol = {
.early_demux = udp_v6_early_demux, .early_demux = udp_v6_early_demux,
.early_demux_handler = udp_v6_early_demux, .early_demux_handler = udp_v6_early_demux,
......
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