Re: [PATCH] net: add pf_family_names[] for protocol family

From: David Miller
Date: Fri Jun 18 2021 - 16:05:18 EST



This patch doers not even compile successfully:

./usr/include/linux/net.h:59:3: error: ʽPF_UNSPECʼ undeclared here (not in a function)
59 | [PF_UNSPEC] = "PF_UNSPEC",
| ^~~~~~~~~
./usr/include/linux/net.h:59:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:59:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:60:3: error: ʽPF_UNIXʼ undeclared here (not in a function)
60 | [PF_UNIX] = "PF_UNIX/PF_LOCAL",
| ^~~~~~~
./usr/include/linux/net.h:60:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:60:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:61:3: error: ʽPF_INETʼ undeclared here (not in a function)
61 | [PF_INET] = "PF_INET",
| ^~~~~~~
./usr/include/linux/net.h:61:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:61:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:62:3: error: ʽPF_AX25ʼ undeclared here (not in a function)
62 | [PF_AX25] = "PF_AX25",
| ^~~~~~~
./usr/include/linux/net.h:62:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:62:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:63:3: error: ʽPF_IPXʼ undeclared here (not in a function)
63 | [PF_IPX] = "PF_IPX",
| ^~~~~~
./usr/include/linux/net.h:63:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:63:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:64:3: error: ʽPF_APPLETALKʼ undeclared here (not in a function)
64 | [PF_APPLETALK] = "PF_APPLETALK",
| ^~~~~~~~~~~~
./usr/include/linux/net.h:64:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:64:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:65:3: error: ʽPF_NETROMʼ undeclared here (not in a function)
65 | [PF_NETROM] = "PF_NETROM",
| ^~~~~~~~~
./usr/include/linux/net.h:65:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:65:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:66:3: error: ʽPF_BRIDGEʼ undeclared here (not in a function)
66 | [PF_BRIDGE] = "PF_BRIDGE",
| ^~~~~~~~~
./usr/include/linux/net.h:66:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:66:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:67:3: error: ʽPF_ATMPVCʼ undeclared here (not in a function)
67 | [PF_ATMPVC] = "PF_ATMPVC",
| ^~~~~~~~~
./usr/include/linux/net.h:67:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:67:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:68:3: error: ʽPF_X25ʼ undeclared here (not in a function)
68 | [PF_X25] = "PF_X25",
| ^~~~~~
./usr/include/linux/net.h:68:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:68:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:69:3: error: ʽPF_INET6ʼ undeclared here (not in a function)
69 | [PF_INET6] = "PF_INET6",
| ^~~~~~~~
./usr/include/linux/net.h:69:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:69:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:70:3: error: ʽPF_ROSEʼ undeclared here (not in a function)
70 | [PF_ROSE] = "PF_ROSE",
| ^~~~~~~
./usr/include/linux/net.h:70:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:70:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:71:3: error: ʽPF_DECnetʼ undeclared here (not in a function)
71 | [PF_DECnet] = "PF_DECnet",
| ^~~~~~~~~
./usr/include/linux/net.h:71:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:71:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:72:3: error: ʽPF_NETBEUIʼ undeclared here (not in a function)
72 | [PF_NETBEUI] = "PF_NETBEUI",
| ^~~~~~~~~~
./usr/include/linux/net.h:72:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:72:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:73:3: error: ʽPF_SECURITYʼ undeclared here (not in a function)
73 | [PF_SECURITY] = "PF_SECURITY",
| ^~~~~~~~~~~
./usr/include/linux/net.h:73:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:73:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:74:3: error: ʽPF_KEYʼ undeclared here (not in a function)
74 | [PF_KEY] = "PF_KEY",
| ^~~~~~
./usr/include/linux/net.h:74:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:74:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:75:3: error: ʽPF_NETLINKʼ undeclared here (not in a function)
75 | [PF_NETLINK] = "PF_NETLINK/PF_ROUTE",
| ^~~~~~~~~~
./usr/include/linux/net.h:75:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:75:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:76:3: error: ʽPF_PACKETʼ undeclared here (not in a function)
76 | [PF_PACKET] = "PF_PACKET",
| ^~~~~~~~~
./usr/include/linux/net.h:76:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:76:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:77:3: error: ʽPF_ASHʼ undeclared here (not in a function)
77 | [PF_ASH] = "PF_ASH",
| ^~~~~~
./usr/include/linux/net.h:77:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:77:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:78:3: error: ʽPF_ECONETʼ undeclared here (not in a function)
78 | [PF_ECONET] = "PF_ECONET",
| ^~~~~~~~~
./usr/include/linux/net.h:78:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:78:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:79:3: error: ʽPF_ATMSVCʼ undeclared here (not in a function)
79 | [PF_ATMSVC] = "PF_ATMSVC",
| ^~~~~~~~~
./usr/include/linux/net.h:79:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:79:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:80:3: error: ʽPF_RDSʼ undeclared here (not in a function)
80 | [PF_RDS] = "PF_RDS",
| ^~~~~~
./usr/include/linux/net.h:80:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:80:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:81:3: error: ʽPF_SNAʼ undeclared here (not in a function)
81 | [PF_SNA] = "PF_SNA",
| ^~~~~~
./usr/include/linux/net.h:81:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:81:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:82:3: error: ʽPF_IRDAʼ undeclared here (not in a function)
82 | [PF_IRDA] = "PF_IRDA",
| ^~~~~~~
./usr/include/linux/net.h:82:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:82:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:83:3: error: ʽPF_PPPOXʼ undeclared here (not in a function)
83 | [PF_PPPOX] = "PF_PPPOX",
| ^~~~~~~~
./usr/include/linux/net.h:83:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:83:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:84:3: error: ʽPF_WANPIPEʼ undeclared here (not in a function)
84 | [PF_WANPIPE] = "PF_WANPIPE",
| ^~~~~~~~~~
./usr/include/linux/net.h:84:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:84:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:85:3: error: ʽPF_LLCʼ undeclared here (not in a function)
85 | [PF_LLC] = "PF_LLC",
| ^~~~~~
./usr/include/linux/net.h:85:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:85:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:86:3: error: ʽPF_IBʼ undeclared here (not in a function)
86 | [PF_IB] = "PF_IB",
| ^~~~~
./usr/include/linux/net.h:86:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:86:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:87:3: error: ʽPF_MPLSʼ undeclared here (not in a function)
87 | [PF_MPLS] = "PF_MPLS",
| ^~~~~~~
./usr/include/linux/net.h:87:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:87:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:88:3: error: ʽPF_CANʼ undeclared here (not in a function)
88 | [PF_CAN] = "PF_CAN",
| ^~~~~~
./usr/include/linux/net.h:88:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:88:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:89:3: error: ʽPF_TIPCʼ undeclared here (not in a function)
89 | [PF_TIPC] = "PF_TIPC",
| ^~~~~~~
./usr/include/linux/net.h:89:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:89:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:90:3: error: ʽPF_BLUETOOTHʼ undeclared here (not in a function)
90 | [PF_BLUETOOTH] = "PF_BLUETOOTH",
| ^~~~~~~~~~~~
./usr/include/linux/net.h:90:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:90:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:91:3: error: ʽPF_IUCVʼ undeclared here (not in a function)
91 | [PF_IUCV] = "PF_IUCV",
| ^~~~~~~
./usr/include/linux/net.h:91:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:91:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:92:3: error: ʽPF_RXRPCʼ undeclared here (not in a function)
92 | [PF_RXRPC] = "PF_RXRPC",
| ^~~~~~~~
./usr/include/linux/net.h:92:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:92:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:93:3: error: ʽPF_ISDNʼ undeclared here (not in a function)
93 | [PF_ISDN] = "PF_ISDN",
| ^~~~~~~
./usr/include/linux/net.h:93:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:93:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:94:3: error: ʽPF_PHONETʼ undeclared here (not in a function)
94 | [PF_PHONET] = "PF_PHONET",
| ^~~~~~~~~
./usr/include/linux/net.h:94:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:94:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:95:3: error: ʽPF_IEEE802154ʼ undeclared here (not in a function)
95 | [PF_IEEE802154] = "PF_IEEE802154",
| ^~~~~~~~~~~~~
./usr/include/linux/net.h:95:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:95:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:96:3: error: ʽPF_CAIFʼ undeclared here (not in a function)
96 | [PF_CAIF] = "PF_CAIF",
| ^~~~~~~
./usr/include/linux/net.h:96:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:96:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:97:3: error: ʽPF_ALGʼ undeclared here (not in a function)
97 | [PF_ALG] = "PF_ALG",
| ^~~~~~
./usr/include/linux/net.h:97:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:97:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:98:3: error: ʽPF_NFCʼ undeclared here (not in a function)
98 | [PF_NFC] = "PF_NFC",
| ^~~~~~
./usr/include/linux/net.h:98:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:98:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:99:3: error: ʽPF_VSOCKʼ undeclared here (not in a function)
99 | [PF_VSOCK] = "PF_VSOCK",
| ^~~~~~~~
./usr/include/linux/net.h:99:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:99:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:100:3: error: ʽPF_KCMʼ undeclared here (not in a function)
100 | [PF_KCM] = "PF_KCM",
| ^~~~~~
./usr/include/linux/net.h:100:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:100:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:101:3: error: ʽPF_QIPCRTRʼ undeclared here (not in a function)
101 | [PF_QIPCRTR] = "PF_QIPCRTR",
| ^~~~~~~~~~
./usr/include/linux/net.h:101:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:101:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:102:3: error: ʽPF_SMCʼ undeclared here (not in a function)
102 | [PF_SMC] = "PF_SMC",
| ^~~~~~
./usr/include/linux/net.h:102:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:102:3: note: (near initialization for ʽpf_family_namesʼ)
./usr/include/linux/net.h:103:3: error: ʽPF_XDPʼ undeclared here (not in a function)
103 | [PF_XDP] = "PF_XDP",
| ^~~~~~
./usr/include/linux/net.h:103:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:103:3: note: (near initialization for ʽpf_family_namesʼ)

Please fix, thank you.