Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: Remove the member netns_ok

Every protocol has the 'netns_ok' member and it is euqal to 1. The
'if (!prot->netns_ok)' always false in inet_add_protocol().

Signed-off-by: Yejune Deng <yejunedeng@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yejune Deng and committed by
David S. Miller
5796254e 609c8ae8

-23
-1
include/net/protocol.h
··· 43 43 int (*err_handler)(struct sk_buff *skb, u32 info); 44 44 45 45 unsigned int no_policy:1, 46 - netns_ok:1, 47 46 /* does the protocol do more stringent 48 47 * icmp tag validation than simple 49 48 * socket lookup?
-1
net/dccp/ipv4.c
··· 977 977 .handler = dccp_v4_rcv, 978 978 .err_handler = dccp_v4_err, 979 979 .no_policy = 1, 980 - .netns_ok = 1, 981 980 .icmp_strict_tag_validation = 1, 982 981 }; 983 982
-4
net/ipv4/af_inet.c
··· 1720 1720 #ifdef CONFIG_IP_MULTICAST 1721 1721 static const struct net_protocol igmp_protocol = { 1722 1722 .handler = igmp_rcv, 1723 - .netns_ok = 1, 1724 1723 }; 1725 1724 #endif 1726 1725 ··· 1732 1733 .handler = tcp_v4_rcv, 1733 1734 .err_handler = tcp_v4_err, 1734 1735 .no_policy = 1, 1735 - .netns_ok = 1, 1736 1736 .icmp_strict_tag_validation = 1, 1737 1737 }; 1738 1738 ··· 1744 1746 .handler = udp_rcv, 1745 1747 .err_handler = udp_err, 1746 1748 .no_policy = 1, 1747 - .netns_ok = 1, 1748 1749 }; 1749 1750 1750 1751 static const struct net_protocol icmp_protocol = { 1751 1752 .handler = icmp_rcv, 1752 1753 .err_handler = icmp_err, 1753 1754 .no_policy = 1, 1754 - .netns_ok = 1, 1755 1755 }; 1756 1756 1757 1757 static __net_init int ipv4_mib_init_net(struct net *net)
-1
net/ipv4/gre_demux.c
··· 195 195 static const struct net_protocol net_gre_protocol = { 196 196 .handler = gre_rcv, 197 197 .err_handler = gre_err, 198 - .netns_ok = 1, 199 198 }; 200 199 201 200 static int __init gre_init(void)
-1
net/ipv4/ipmr.c
··· 3007 3007 #ifdef CONFIG_IP_PIMSM_V2 3008 3008 static const struct net_protocol pim_protocol = { 3009 3009 .handler = pim_rcv, 3010 - .netns_ok = 1, 3011 3010 }; 3012 3011 #endif 3013 3012
-6
net/ipv4/protocol.c
··· 31 31 32 32 int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol) 33 33 { 34 - if (!prot->netns_ok) { 35 - pr_err("Protocol %u is not namespace aware, cannot register.\n", 36 - protocol); 37 - return -EINVAL; 38 - } 39 - 40 34 return !cmpxchg((const struct net_protocol **)&inet_protos[protocol], 41 35 NULL, prot) ? 0 : -1; 42 36 }
-3
net/ipv4/tunnel4.c
··· 218 218 .handler = tunnel4_rcv, 219 219 .err_handler = tunnel4_err, 220 220 .no_policy = 1, 221 - .netns_ok = 1, 222 221 }; 223 222 224 223 #if IS_ENABLED(CONFIG_IPV6) ··· 225 226 .handler = tunnel64_rcv, 226 227 .err_handler = tunnel64_err, 227 228 .no_policy = 1, 228 - .netns_ok = 1, 229 229 }; 230 230 #endif 231 231 ··· 233 235 .handler = tunnelmpls4_rcv, 234 236 .err_handler = tunnelmpls4_err, 235 237 .no_policy = 1, 236 - .netns_ok = 1, 237 238 }; 238 239 #endif 239 240
-1
net/ipv4/udplite.c
··· 31 31 .handler = udplite_rcv, 32 32 .err_handler = udplite_err, 33 33 .no_policy = 1, 34 - .netns_ok = 1, 35 34 }; 36 35 37 36 struct proto udplite_prot = {
-3
net/ipv4/xfrm4_protocol.c
··· 181 181 .handler = xfrm4_esp_rcv, 182 182 .err_handler = xfrm4_esp_err, 183 183 .no_policy = 1, 184 - .netns_ok = 1, 185 184 }; 186 185 187 186 static const struct net_protocol ah4_protocol = { 188 187 .handler = xfrm4_ah_rcv, 189 188 .err_handler = xfrm4_ah_err, 190 189 .no_policy = 1, 191 - .netns_ok = 1, 192 190 }; 193 191 194 192 static const struct net_protocol ipcomp4_protocol = { 195 193 .handler = xfrm4_ipcomp_rcv, 196 194 .err_handler = xfrm4_ipcomp_err, 197 195 .no_policy = 1, 198 - .netns_ok = 1, 199 196 }; 200 197 201 198 static const struct xfrm_input_afinfo xfrm4_input_afinfo = {
-1
net/l2tp/l2tp_ip.c
··· 635 635 636 636 static struct net_protocol l2tp_ip_protocol __read_mostly = { 637 637 .handler = l2tp_ip_recv, 638 - .netns_ok = 1, 639 638 }; 640 639 641 640 static int __init l2tp_ip_init(void)
-1
net/sctp/protocol.c
··· 1171 1171 .handler = sctp4_rcv, 1172 1172 .err_handler = sctp_v4_err, 1173 1173 .no_policy = 1, 1174 - .netns_ok = 1, 1175 1174 .icmp_strict_tag_validation = 1, 1176 1175 }; 1177 1176