net: Add comment that early_demux can change via sysctl
authorDavid Ahern <dsahern@gmail.com>
Mon, 28 Aug 2017 22:14:20 +0000 (15:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Aug 2017 22:17:29 +0000 (15:17 -0700)
Twice patches trying to constify inet{6}_protocol have been reverted:
39294c3df2a8 ("Revert "ipv6: constify inet6_protocol structures"") to
revert 3a3a4e3054137 and then 03157937fe0b5 ("Revert "ipv4: make
net_protocol const"") to revert aa8db499ea67.

Add a comment that the structures can not be const because the
early_demux field can change based on a sysctl.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/af_inet.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c

index d678820e430686ef96e40cb1a05df9cf2773856f..e31108e5ef79c574751bb23773b41c2daf6e0975 100644 (file)
@@ -1596,6 +1596,9 @@ static const struct net_protocol igmp_protocol = {
 };
 #endif
 
+/* thinking of making this const? Don't.
+ * early_demux can change based on sysctl.
+ */
 static struct net_protocol tcp_protocol = {
        .early_demux    =       tcp_v4_early_demux,
        .early_demux_handler =  tcp_v4_early_demux,
@@ -1606,6 +1609,9 @@ static struct net_protocol tcp_protocol = {
        .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 = {
        .early_demux =  udp_v4_early_demux,
        .early_demux_handler =  udp_v4_early_demux,
index abba3bc2a3d9bdd9357dcb833afb2ff1fa71aba9..38f76d8b231e3e5923ad72d05b8d320b6aeb850f 100644 (file)
@@ -1949,6 +1949,9 @@ struct proto tcpv6_prot = {
        .diag_destroy           = tcp_abort,
 };
 
+/* thinking of making this const? Don't.
+ * early_demux can change based on sysctl.
+ */
 static struct inet6_protocol tcpv6_protocol = {
        .early_demux    =       tcp_v6_early_demux,
        .early_demux_handler =  tcp_v6_early_demux,
index 2a15f1bb6ef8643a07997b89f71f034231ea653c..976f3039135612ffea9da4861f7cf17fa797d77c 100644 (file)
@@ -1472,6 +1472,9 @@ int compat_udpv6_getsockopt(struct sock *sk, int level, int optname,
 }
 #endif
 
+/* thinking of making this const? Don't.
+ * early_demux can change based on sysctl.
+ */
 static struct inet6_protocol udpv6_protocol = {
        .early_demux    =       udp_v6_early_demux,
        .early_demux_handler =  udp_v6_early_demux,