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 :

Reply via email to