@@ -1751,19 +1751,6 @@ static const struct net_protocol igmp_protocol = {
1751
1751
};
1752
1752
#endif
1753
1753
1754
- static const struct net_protocol tcp_protocol = {
1755
- .handler = tcp_v4_rcv ,
1756
- .err_handler = tcp_v4_err ,
1757
- .no_policy = 1 ,
1758
- .icmp_strict_tag_validation = 1 ,
1759
- };
1760
-
1761
- static const struct net_protocol udp_protocol = {
1762
- .handler = udp_rcv ,
1763
- .err_handler = udp_err ,
1764
- .no_policy = 1 ,
1765
- };
1766
-
1767
1754
static const struct net_protocol icmp_protocol = {
1768
1755
.handler = icmp_rcv ,
1769
1756
.err_handler = icmp_err ,
@@ -1992,9 +1979,22 @@ static int __init inet_init(void)
1992
1979
1993
1980
if (inet_add_protocol (& icmp_protocol , IPPROTO_ICMP ) < 0 )
1994
1981
pr_crit ("%s: Cannot add ICMP protocol\n" , __func__ );
1995
- if (inet_add_protocol (& udp_protocol , IPPROTO_UDP ) < 0 )
1982
+
1983
+ net_hotdata .udp_protocol = (struct net_protocol ) {
1984
+ .handler = udp_rcv ,
1985
+ .err_handler = udp_err ,
1986
+ .no_policy = 1 ,
1987
+ };
1988
+ if (inet_add_protocol (& net_hotdata .udp_protocol , IPPROTO_UDP ) < 0 )
1996
1989
pr_crit ("%s: Cannot add UDP protocol\n" , __func__ );
1997
- if (inet_add_protocol (& tcp_protocol , IPPROTO_TCP ) < 0 )
1990
+
1991
+ net_hotdata .tcp_protocol = (struct net_protocol ) {
1992
+ .handler = tcp_v4_rcv ,
1993
+ .err_handler = tcp_v4_err ,
1994
+ .no_policy = 1 ,
1995
+ .icmp_strict_tag_validation = 1 ,
1996
+ };
1997
+ if (inet_add_protocol (& net_hotdata .tcp_protocol , IPPROTO_TCP ) < 0 )
1998
1998
pr_crit ("%s: Cannot add TCP protocol\n" , __func__ );
1999
1999
#ifdef CONFIG_IP_MULTICAST
2000
2000
if (inet_add_protocol (& igmp_protocol , IPPROTO_IGMP ) < 0 )
0 commit comments