Skip to content

Commit 39294c3

Browse files
JuliaLawalldavem330
authored andcommitted
Revert "ipv6: constify inet6_protocol structures"
This reverts commit 3a3a4e3. inet6_add_protocol and inet6_del_protocol include casts that remove the effect of the const annotation on their parameter, leading to possible runtime crashes. Reported-by: Eric Dumazet <[email protected]> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1f139ed commit 39294c3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

net/ipv6/ip6_gre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ static void ip6gre_fb_tunnel_init(struct net_device *dev)
10801080
}
10811081

10821082

1083-
static const struct inet6_protocol ip6gre_protocol = {
1083+
static struct inet6_protocol ip6gre_protocol __read_mostly = {
10841084
.handler = gre_rcv,
10851085
.err_handler = ip6gre_err,
10861086
.flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,

net/ipv6/tcp_ipv6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ struct proto tcpv6_prot = {
19441944
.diag_destroy = tcp_abort,
19451945
};
19461946

1947-
static const struct inet6_protocol tcpv6_protocol = {
1947+
static struct inet6_protocol tcpv6_protocol = {
19481948
.early_demux = tcp_v6_early_demux,
19491949
.early_demux_handler = tcp_v6_early_demux,
19501950
.handler = tcp_v6_rcv,

net/ipv6/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ int compat_udpv6_getsockopt(struct sock *sk, int level, int optname,
14481448
}
14491449
#endif
14501450

1451-
static const struct inet6_protocol udpv6_protocol = {
1451+
static struct inet6_protocol udpv6_protocol = {
14521452
.early_demux = udp_v6_early_demux,
14531453
.early_demux_handler = udp_v6_early_demux,
14541454
.handler = udpv6_rcv,

0 commit comments

Comments
 (0)