[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55ee348e-3193-f384-b4a9-3f773052a154@gmail.com>
Date: Tue, 29 Aug 2017 10:47:15 -0600
From: David Ahern <dsahern@...il.com>
To: Bhumika Goyal <bhumirks@...il.com>
Cc: netdev@...r.kernel.org, David Miller <davem@...emloft.net>
Subject: Re: [PATCH net-next] Revert "ipv4: make net_protocol const"
On 8/29/17 12:46 AM, Bhumika Goyal wrote:
> I am compile testing them. In this case I did: make
> net/ipv4/af_inet.o and it compiled. Is this error because of
> typecasting net_protocol inside inet_add_protocol function?
Compile testing is not sufficient. Marking data structures read-only
leaves potential land mines for others to trip over at run-time.
You are making these changes based on a code analysis. Extend the
analysis to elements of the structure. In this case early_demux is the
first element. There are only 9 references to early_demux and cscope
very quickly tells you it can be changed:
7 sysctl_net_ipv4.c proc_configure_early_demux 312 ipprot->early_demux
= enabled ? ipprot->early_demux_handler :
8 sysctl_net_ipv4.c proc_configure_early_demux 318 ip6prot->early_demux
= enabled ? ip6prot->early_demux_handler :
Powered by blists - more mailing lists