aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/event.c1
-rw-r--r--drivers/net/gtp.c1
-rw-r--r--drivers/net/macsec.c1
-rw-r--r--drivers/net/team/team.c1
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c1
-rw-r--r--drivers/scsi/pmcraid.c6
-rw-r--r--drivers/target/target_core_user.c1
-rw-r--r--drivers/thermal/thermal_core.c1
-rw-r--r--fs/dlm/netlink.c1
-rw-r--r--fs/quota/netlink.c7
-rw-r--r--include/linux/genl_magic_func.h1
-rw-r--r--include/net/genetlink.h7
-rw-r--r--include/uapi/linux/genetlink.h1
-rw-r--r--kernel/taskstats.c1
-rw-r--r--net/batman-adv/netlink.c1
-rw-r--r--net/core/devlink.c1
-rw-r--r--net/core/drop_monitor.c1
-rw-r--r--net/hsr/hsr_netlink.c1
-rw-r--r--net/ieee802154/netlink.c1
-rw-r--r--net/ieee802154/nl802154.c1
-rw-r--r--net/ipv4/fou.c1
-rw-r--r--net/ipv4/tcp_metrics.c1
-rw-r--r--net/ipv6/ila/ila_xlat.c1
-rw-r--r--net/irda/irnetlink.c1
-rw-r--r--net/l2tp/l2tp_netlink.c1
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c1
-rw-r--r--net/netlabel/netlabel_calipso.c1
-rw-r--r--net/netlabel/netlabel_cipso_v4.c1
-rw-r--r--net/netlabel/netlabel_mgmt.c1
-rw-r--r--net/netlabel/netlabel_unlabeled.c1
-rw-r--r--net/netlink/genetlink.c37
-rw-r--r--net/nfc/netlink.c1
-rw-r--r--net/openvswitch/datapath.c4
-rw-r--r--net/tipc/netlink.c1
-rw-r--r--net/tipc/netlink_compat.c1
-rw-r--r--net/wimax/stack.c1
-rw-r--r--net/wireless/nl80211.c1
37 files changed, 24 insertions, 69 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index e24ea4e796e4..8dfca3d53131 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -83,7 +83,6 @@ static const struct genl_multicast_group acpi_event_mcgrps[] = {
83}; 83};
84 84
85static struct genl_family acpi_event_genl_family = { 85static struct genl_family acpi_event_genl_family = {
86 .id = GENL_ID_GENERATE,
87 .name = ACPI_GENL_FAMILY_NAME, 86 .name = ACPI_GENL_FAMILY_NAME,
88 .version = ACPI_GENL_VERSION, 87 .version = ACPI_GENL_VERSION,
89 .maxattr = ACPI_GENL_ATTR_MAX, 88 .maxattr = ACPI_GENL_ATTR_MAX,
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 97e0cbca0a08..f66737ba1299 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -1095,7 +1095,6 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info)
1095} 1095}
1096 1096
1097static struct genl_family gtp_genl_family = { 1097static struct genl_family gtp_genl_family = {
1098 .id = GENL_ID_GENERATE,
1099 .name = "gtp", 1098 .name = "gtp",
1100 .version = 0, 1099 .version = 0,
1101 .hdrsize = 0, 1100 .hdrsize = 0,
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 1a134cb2d52c..a5309b81a786 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -1422,7 +1422,6 @@ static void clear_tx_sa(struct macsec_tx_sa *tx_sa)
1422} 1422}
1423 1423
1424static struct genl_family macsec_fam = { 1424static struct genl_family macsec_fam = {
1425 .id = GENL_ID_GENERATE,
1426 .name = MACSEC_GENL_NAME, 1425 .name = MACSEC_GENL_NAME,
1427 .hdrsize = 0, 1426 .hdrsize = 0,
1428 .version = MACSEC_GENL_VERSION, 1427 .version = MACSEC_GENL_VERSION,
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index a380649bf6b5..0b50205764ff 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2151,7 +2151,6 @@ static struct rtnl_link_ops team_link_ops __read_mostly = {
2151 ***********************************/ 2151 ***********************************/
2152 2152
2153static struct genl_family team_nl_family = { 2153static struct genl_family team_nl_family = {
2154 .id = GENL_ID_GENERATE,
2155 .name = TEAM_GENL_NAME, 2154 .name = TEAM_GENL_NAME,
2156 .version = TEAM_GENL_VERSION, 2155 .version = TEAM_GENL_VERSION,
2157 .maxattr = TEAM_ATTR_MAX, 2156 .maxattr = TEAM_ATTR_MAX,
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index e95b79bccf9b..54b6cd62676e 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -589,7 +589,6 @@ struct hwsim_radiotap_ack_hdr {
589 589
590/* MAC80211_HWSIM netlinf family */ 590/* MAC80211_HWSIM netlinf family */
591static struct genl_family hwsim_genl_family = { 591static struct genl_family hwsim_genl_family = {
592 .id = GENL_ID_GENERATE,
593 .hdrsize = 0, 592 .hdrsize = 0,
594 .name = "MAC80211_HWSIM", 593 .name = "MAC80211_HWSIM",
595 .version = 1, 594 .version = 1,
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 68a5c347fae9..cc50eb87b28a 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -1369,12 +1369,6 @@ static struct genl_multicast_group pmcraid_mcgrps[] = {
1369}; 1369};
1370 1370
1371static struct genl_family pmcraid_event_family = { 1371static struct genl_family pmcraid_event_family = {
1372 /*
1373 * Due to prior multicast group abuse (the code having assumed that
1374 * the family ID can be used as a multicast group ID) we need to
1375 * statically allocate a family (and thus group) ID.
1376 */
1377 .id = GENL_ID_PMCRAID,
1378 .name = "pmcraid", 1372 .name = "pmcraid",
1379 .version = 1, 1373 .version = 1,
1380 .maxattr = PMCRAID_AEN_ATTR_MAX, 1374 .maxattr = PMCRAID_AEN_ATTR_MAX,
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 62bf4fe5704a..313a0ef3cda7 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -148,7 +148,6 @@ static const struct genl_multicast_group tcmu_mcgrps[] = {
148 148
149/* Our generic netlink family */ 149/* Our generic netlink family */
150static struct genl_family tcmu_genl_family = { 150static struct genl_family tcmu_genl_family = {
151 .id = GENL_ID_GENERATE,
152 .hdrsize = 0, 151 .hdrsize = 0,
153 .name = "TCM-USER", 152 .name = "TCM-USER",
154 .version = 1, 153 .version = 1,
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 226b0b4aced6..68d7503f6417 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -2164,7 +2164,6 @@ static const struct genl_multicast_group thermal_event_mcgrps[] = {
2164}; 2164};
2165 2165
2166static struct genl_family thermal_event_genl_family = { 2166static struct genl_family thermal_event_genl_family = {
2167 .id = GENL_ID_GENERATE,
2168 .name = THERMAL_GENL_FAMILY_NAME, 2167 .name = THERMAL_GENL_FAMILY_NAME,
2169 .version = THERMAL_GENL_VERSION, 2168 .version = THERMAL_GENL_VERSION,
2170 .maxattr = THERMAL_GENL_ATTR_MAX, 2169 .maxattr = THERMAL_GENL_ATTR_MAX,
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c
index 1e6e227134d7..00d226956264 100644
--- a/fs/dlm/netlink.c
+++ b/fs/dlm/netlink.c
@@ -17,7 +17,6 @@ static uint32_t dlm_nl_seqnum;
17static uint32_t listener_nlportid; 17static uint32_t listener_nlportid;
18 18
19static struct genl_family family = { 19static struct genl_family family = {
20 .id = GENL_ID_GENERATE,
21 .name = DLM_GENL_NAME, 20 .name = DLM_GENL_NAME,
22 .version = DLM_GENL_VERSION, 21 .version = DLM_GENL_VERSION,
23}; 22};
diff --git a/fs/quota/netlink.c b/fs/quota/netlink.c
index 8b252673d454..3965a5cdfaa2 100644
--- a/fs/quota/netlink.c
+++ b/fs/quota/netlink.c
@@ -13,13 +13,6 @@ static const struct genl_multicast_group quota_mcgrps[] = {
13 13
14/* Netlink family structure for quota */ 14/* Netlink family structure for quota */
15static struct genl_family quota_genl_family = { 15static struct genl_family quota_genl_family = {
16 /*
17 * Needed due to multicast group ID abuse - old code assumed
18 * the family ID was also a valid multicast group ID (which
19 * isn't true) and userspace might thus rely on it. Assign a
20 * static ID for this group to make dealing with that easier.
21 */
22 .id = GENL_ID_VFS_DQUOT,
23 .hdrsize = 0, 16 .hdrsize = 0,
24 .name = "VFS_DQUOT", 17 .name = "VFS_DQUOT",
25 .version = 1, 18 .version = 1,
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h
index 667c31101b8b..7c070c1fe457 100644
--- a/include/linux/genl_magic_func.h
+++ b/include/linux/genl_magic_func.h
@@ -260,7 +260,6 @@ static struct genl_ops ZZZ_genl_ops[] __read_mostly = {
260 */ 260 */
261#define ZZZ_genl_family CONCAT_(GENL_MAGIC_FAMILY, _genl_family) 261#define ZZZ_genl_family CONCAT_(GENL_MAGIC_FAMILY, _genl_family)
262static struct genl_family ZZZ_genl_family __read_mostly = { 262static struct genl_family ZZZ_genl_family __read_mostly = {
263 .id = GENL_ID_GENERATE,
264 .name = __stringify(GENL_MAGIC_FAMILY), 263 .name = __stringify(GENL_MAGIC_FAMILY),
265 .version = GENL_MAGIC_VERSION, 264 .version = GENL_MAGIC_VERSION,
266#ifdef GENL_MAGIC_FAMILY_HDRSZ 265#ifdef GENL_MAGIC_FAMILY_HDRSZ
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index ef9defb3f5bc..43a5c3975a2f 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -20,7 +20,7 @@ struct genl_info;
20 20
21/** 21/**
22 * struct genl_family - generic netlink family 22 * struct genl_family - generic netlink family
23 * @id: protocol family idenfitier 23 * @id: protocol family identifier (private)
24 * @hdrsize: length of user specific header in bytes 24 * @hdrsize: length of user specific header in bytes
25 * @name: name of family 25 * @name: name of family
26 * @version: protocol version 26 * @version: protocol version
@@ -48,7 +48,7 @@ struct genl_info;
48 * @n_ops: number of operations supported by this family (private) 48 * @n_ops: number of operations supported by this family (private)
49 */ 49 */
50struct genl_family { 50struct genl_family {
51 unsigned int id; 51 unsigned int id; /* private */
52 unsigned int hdrsize; 52 unsigned int hdrsize;
53 char name[GENL_NAMSIZ]; 53 char name[GENL_NAMSIZ];
54 unsigned int version; 54 unsigned int version;
@@ -149,9 +149,6 @@ static inline int genl_register_family(struct genl_family *family)
149 * Registers the specified family and operations from the specified table. 149 * Registers the specified family and operations from the specified table.
150 * Only one family may be registered with the same family name or identifier. 150 * Only one family may be registered with the same family name or identifier.
151 * 151 *
152 * The family id may equal GENL_ID_GENERATE causing an unique id to
153 * be automatically generated and assigned.
154 *
155 * Either a doit or dumpit callback must be specified for every registered 152 * Either a doit or dumpit callback must be specified for every registered
156 * operation or the function will fail. Only one operation structure per 153 * operation or the function will fail. Only one operation structure per
157 * command identifier may be registered. 154 * command identifier may be registered.
diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h
index 5512c90af7e3..d9b2db4a29c6 100644
--- a/include/uapi/linux/genetlink.h
+++ b/include/uapi/linux/genetlink.h
@@ -26,7 +26,6 @@ struct genlmsghdr {
26/* 26/*
27 * List of reserved static generic netlink identifiers: 27 * List of reserved static generic netlink identifiers:
28 */ 28 */
29#define GENL_ID_GENERATE 0
30#define GENL_ID_CTRL NLMSG_MIN_TYPE 29#define GENL_ID_CTRL NLMSG_MIN_TYPE
31#define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) 30#define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1)
32#define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2) 31#define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2)
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index b3f05ee20d18..d7a1a9461a10 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -42,7 +42,6 @@ static int family_registered;
42struct kmem_cache *taskstats_cache; 42struct kmem_cache *taskstats_cache;
43 43
44static struct genl_family family = { 44static struct genl_family family = {
45 .id = GENL_ID_GENERATE,
46 .name = TASKSTATS_GENL_NAME, 45 .name = TASKSTATS_GENL_NAME,
47 .version = TASKSTATS_GENL_VERSION, 46 .version = TASKSTATS_GENL_VERSION,
48 .maxattr = TASKSTATS_CMD_ATTR_MAX, 47 .maxattr = TASKSTATS_CMD_ATTR_MAX,
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 64cb6acbe0a6..a03b0ed7e8dd 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -49,7 +49,6 @@
49#include "translation-table.h" 49#include "translation-table.h"
50 50
51struct genl_family batadv_netlink_family = { 51struct genl_family batadv_netlink_family = {
52 .id = GENL_ID_GENERATE,
53 .hdrsize = 0, 52 .hdrsize = 0,
54 .name = BATADV_NL_NAME, 53 .name = BATADV_NL_NAME,
55 .version = 1, 54 .version = 1,
diff --git a/net/core/devlink.c b/net/core/devlink.c
index d2fd736de6a2..3008d9c33875 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -342,7 +342,6 @@ static void devlink_nl_post_doit(const struct genl_ops *ops,
342} 342}
343 343
344static struct genl_family devlink_nl_family = { 344static struct genl_family devlink_nl_family = {
345 .id = GENL_ID_GENERATE,
346 .name = DEVLINK_GENL_NAME, 345 .name = DEVLINK_GENL_NAME,
347 .version = DEVLINK_GENL_VERSION, 346 .version = DEVLINK_GENL_VERSION,
348 .maxattr = DEVLINK_ATTR_MAX, 347 .maxattr = DEVLINK_ATTR_MAX,
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 72cfb0c61125..a5320dfcd978 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -60,7 +60,6 @@ struct dm_hw_stat_delta {
60}; 60};
61 61
62static struct genl_family net_drop_monitor_family = { 62static struct genl_family net_drop_monitor_family = {
63 .id = GENL_ID_GENERATE,
64 .hdrsize = 0, 63 .hdrsize = 0,
65 .name = "NET_DM", 64 .name = "NET_DM",
66 .version = 2, 65 .version = 2,
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c
index d4d1617f43a8..2ad039492bee 100644
--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -132,7 +132,6 @@ static const struct nla_policy hsr_genl_policy[HSR_A_MAX + 1] = {
132}; 132};
133 133
134static struct genl_family hsr_genl_family = { 134static struct genl_family hsr_genl_family = {
135 .id = GENL_ID_GENERATE,
136 .hdrsize = 0, 135 .hdrsize = 0,
137 .name = "HSR", 136 .name = "HSR",
138 .version = 1, 137 .version = 1,
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c
index c8133c07ceee..19144158b696 100644
--- a/net/ieee802154/netlink.c
+++ b/net/ieee802154/netlink.c
@@ -29,7 +29,6 @@ static unsigned int ieee802154_seq_num;
29static DEFINE_SPINLOCK(ieee802154_seq_lock); 29static DEFINE_SPINLOCK(ieee802154_seq_lock);
30 30
31struct genl_family nl802154_family = { 31struct genl_family nl802154_family = {
32 .id = GENL_ID_GENERATE,
33 .hdrsize = 0, 32 .hdrsize = 0,
34 .name = IEEE802154_NL_NAME, 33 .name = IEEE802154_NL_NAME,
35 .version = 1, 34 .version = 1,
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 21aabadccd0e..182299858f1d 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -34,7 +34,6 @@ static void nl802154_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
34 34
35/* the netlink family */ 35/* the netlink family */
36static struct genl_family nl802154_fam = { 36static struct genl_family nl802154_fam = {
37 .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */
38 .name = NL802154_GENL_NAME, /* have users key off the name instead */ 37 .name = NL802154_GENL_NAME, /* have users key off the name instead */
39 .hdrsize = 0, /* no private header */ 38 .hdrsize = 0, /* no private header */
40 .version = 1, /* no particular meaning now */ 39 .version = 1, /* no particular meaning now */
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index cf50f7e2b012..e3fc527c5d37 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -623,7 +623,6 @@ static int fou_destroy(struct net *net, struct fou_cfg *cfg)
623} 623}
624 624
625static struct genl_family fou_nl_family = { 625static struct genl_family fou_nl_family = {
626 .id = GENL_ID_GENERATE,
627 .hdrsize = 0, 626 .hdrsize = 0,
628 .name = FOU_GENL_NAME, 627 .name = FOU_GENL_NAME,
629 .version = FOU_GENL_VERSION, 628 .version = FOU_GENL_VERSION,
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index bf1f3b2b29d1..3da305127b32 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -743,7 +743,6 @@ void tcp_fastopen_cache_set(struct sock *sk, u16 mss,
743} 743}
744 744
745static struct genl_family tcp_metrics_nl_family = { 745static struct genl_family tcp_metrics_nl_family = {
746 .id = GENL_ID_GENERATE,
747 .hdrsize = 0, 746 .hdrsize = 0,
748 .name = TCP_METRICS_GENL_NAME, 747 .name = TCP_METRICS_GENL_NAME,
749 .version = TCP_METRICS_GENL_VERSION, 748 .version = TCP_METRICS_GENL_VERSION,
diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c
index e604013dd814..0d57e27d1cdd 100644
--- a/net/ipv6/ila/ila_xlat.c
+++ b/net/ipv6/ila/ila_xlat.c
@@ -119,7 +119,6 @@ static const struct rhashtable_params rht_params = {
119}; 119};
120 120
121static struct genl_family ila_nl_family = { 121static struct genl_family ila_nl_family = {
122 .id = GENL_ID_GENERATE,
123 .hdrsize = 0, 122 .hdrsize = 0,
124 .name = ILA_GENL_NAME, 123 .name = ILA_GENL_NAME,
125 .version = ILA_GENL_VERSION, 124 .version = ILA_GENL_VERSION,
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c
index e15c40e86660..f23b81aa91fe 100644
--- a/net/irda/irnetlink.c
+++ b/net/irda/irnetlink.c
@@ -25,7 +25,6 @@
25 25
26 26
27static struct genl_family irda_nl_family = { 27static struct genl_family irda_nl_family = {
28 .id = GENL_ID_GENERATE,
29 .name = IRDA_NL_NAME, 28 .name = IRDA_NL_NAME,
30 .hdrsize = 0, 29 .hdrsize = 0,
31 .version = IRDA_NL_VERSION, 30 .version = IRDA_NL_VERSION,
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index bf3117771822..4fbf1f41ac52 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -32,7 +32,6 @@
32 32
33 33
34static struct genl_family l2tp_nl_family = { 34static struct genl_family l2tp_nl_family = {
35 .id = GENL_ID_GENERATE,
36 .name = L2TP_GENL_NAME, 35 .name = L2TP_GENL_NAME,
37 .version = L2TP_GENL_VERSION, 36 .version = L2TP_GENL_VERSION,
38 .hdrsize = 0, 37 .hdrsize = 0,
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index c3c809b2e712..ceed66cdd03e 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2841,7 +2841,6 @@ static struct nf_sockopt_ops ip_vs_sockopts = {
2841 2841
2842/* IPVS genetlink family */ 2842/* IPVS genetlink family */
2843static struct genl_family ip_vs_genl_family = { 2843static struct genl_family ip_vs_genl_family = {
2844 .id = GENL_ID_GENERATE,
2845 .hdrsize = 0, 2844 .hdrsize = 0,
2846 .name = IPVS_GENL_NAME, 2845 .name = IPVS_GENL_NAME,
2847 .version = IPVS_GENL_VERSION, 2846 .version = IPVS_GENL_VERSION,
diff --git a/net/netlabel/netlabel_calipso.c b/net/netlabel/netlabel_calipso.c
index 2ec93c5e77bb..152e503b8c5d 100644
--- a/net/netlabel/netlabel_calipso.c
+++ b/net/netlabel/netlabel_calipso.c
@@ -61,7 +61,6 @@ struct netlbl_domhsh_walk_arg {
61 61
62/* NetLabel Generic NETLINK CALIPSO family */ 62/* NetLabel Generic NETLINK CALIPSO family */
63static struct genl_family netlbl_calipso_gnl_family = { 63static struct genl_family netlbl_calipso_gnl_family = {
64 .id = GENL_ID_GENERATE,
65 .hdrsize = 0, 64 .hdrsize = 0,
66 .name = NETLBL_NLTYPE_CALIPSO_NAME, 65 .name = NETLBL_NLTYPE_CALIPSO_NAME,
67 .version = NETLBL_PROTO_VERSION, 66 .version = NETLBL_PROTO_VERSION,
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index 7fd1104ba900..755b284e7ad4 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -60,7 +60,6 @@ struct netlbl_domhsh_walk_arg {
60 60
61/* NetLabel Generic NETLINK CIPSOv4 family */ 61/* NetLabel Generic NETLINK CIPSOv4 family */
62static struct genl_family netlbl_cipsov4_gnl_family = { 62static struct genl_family netlbl_cipsov4_gnl_family = {
63 .id = GENL_ID_GENERATE,
64 .hdrsize = 0, 63 .hdrsize = 0,
65 .name = NETLBL_NLTYPE_CIPSOV4_NAME, 64 .name = NETLBL_NLTYPE_CIPSOV4_NAME,
66 .version = NETLBL_PROTO_VERSION, 65 .version = NETLBL_PROTO_VERSION,
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index f85d0e07af2d..3b00f2368fcd 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -61,7 +61,6 @@ struct netlbl_domhsh_walk_arg {
61 61
62/* NetLabel Generic NETLINK CIPSOv4 family */ 62/* NetLabel Generic NETLINK CIPSOv4 family */
63static struct genl_family netlbl_mgmt_gnl_family = { 63static struct genl_family netlbl_mgmt_gnl_family = {
64 .id = GENL_ID_GENERATE,
65 .hdrsize = 0, 64 .hdrsize = 0,
66 .name = NETLBL_NLTYPE_MGMT_NAME, 65 .name = NETLBL_NLTYPE_MGMT_NAME,
67 .version = NETLBL_PROTO_VERSION, 66 .version = NETLBL_PROTO_VERSION,
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 4528cff9138b..c2ea8d1f653a 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -124,7 +124,6 @@ static u8 netlabel_unlabel_acceptflg;
124 124
125/* NetLabel Generic NETLINK unlabeled family */ 125/* NetLabel Generic NETLINK unlabeled family */
126static struct genl_family netlbl_unlabel_gnl_family = { 126static struct genl_family netlbl_unlabel_gnl_family = {
127 .id = GENL_ID_GENERATE,
128 .hdrsize = 0, 127 .hdrsize = 0,
129 .name = NETLBL_NLTYPE_UNLABELED_NAME, 128 .name = NETLBL_NLTYPE_UNLABELED_NAME,
130 .version = NETLBL_PROTO_VERSION, 129 .version = NETLBL_PROTO_VERSION,
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 01291b7a27bb..f19ec969edee 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -349,8 +349,6 @@ static int genl_validate_ops(const struct genl_family *family)
349 * 349 *
350 * Registers the specified family after validating it first. Only one 350 * Registers the specified family after validating it first. Only one
351 * family may be registered with the same family name or identifier. 351 * family may be registered with the same family name or identifier.
352 * The family id may equal GENL_ID_GENERATE causing an unique id to
353 * be automatically generated and assigned.
354 * 352 *
355 * The family's ops array must already be assigned, you can use the 353 * The family's ops array must already be assigned, you can use the
356 * genl_register_family_with_ops() helper function. 354 * genl_register_family_with_ops() helper function.
@@ -359,13 +357,7 @@ static int genl_validate_ops(const struct genl_family *family)
359 */ 357 */
360int __genl_register_family(struct genl_family *family) 358int __genl_register_family(struct genl_family *family)
361{ 359{
362 int err = -EINVAL, i; 360 int err, i;
363
364 if (family->id && family->id < GENL_MIN_ID)
365 goto errout;
366
367 if (family->id > GENL_MAX_ID)
368 goto errout;
369 361
370 err = genl_validate_ops(family); 362 err = genl_validate_ops(family);
371 if (err) 363 if (err)
@@ -378,8 +370,27 @@ int __genl_register_family(struct genl_family *family)
378 goto errout_locked; 370 goto errout_locked;
379 } 371 }
380 372
381 if (family->id == GENL_ID_GENERATE) { 373 if (family == &genl_ctrl) {
382 u16 newid = genl_generate_id(); 374 family->id = GENL_ID_CTRL;
375 } else {
376 u16 newid;
377
378 /* this should be left zero in the struct */
379 WARN_ON(family->id);
380
381 /*
382 * Sadly, a few cases need to be special-cased
383 * due to them having previously abused the API
384 * and having used their family ID also as their
385 * multicast group ID, so we use reserved IDs
386 * for both to be sure we can do that mapping.
387 */
388 if (strcmp(family->name, "pmcraid") == 0)
389 newid = GENL_ID_PMCRAID;
390 else if (strcmp(family->name, "VFS_DQUOT") == 0)
391 newid = GENL_ID_VFS_DQUOT;
392 else
393 newid = genl_generate_id();
383 394
384 if (!newid) { 395 if (!newid) {
385 err = -ENOMEM; 396 err = -ENOMEM;
@@ -387,9 +398,6 @@ int __genl_register_family(struct genl_family *family)
387 } 398 }
388 399
389 family->id = newid; 400 family->id = newid;
390 } else if (genl_family_find_byid(family->id)) {
391 err = -EEXIST;
392 goto errout_locked;
393 } 401 }
394 402
395 if (family->maxattr && !family->parallel_ops) { 403 if (family->maxattr && !family->parallel_ops) {
@@ -419,7 +427,6 @@ int __genl_register_family(struct genl_family *family)
419 427
420errout_locked: 428errout_locked:
421 genl_unlock_all(); 429 genl_unlock_all();
422errout:
423 return err; 430 return err;
424} 431}
425EXPORT_SYMBOL(__genl_register_family); 432EXPORT_SYMBOL(__genl_register_family);
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 79786bf62b88..c230403e066c 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -39,7 +39,6 @@ static const struct genl_multicast_group nfc_genl_mcgrps[] = {
39}; 39};
40 40
41static struct genl_family nfc_genl_family = { 41static struct genl_family nfc_genl_family = {
42 .id = GENL_ID_GENERATE,
43 .hdrsize = 0, 42 .hdrsize = 0,
44 .name = NFC_GENL_NAME, 43 .name = NFC_GENL_NAME,
45 .version = NFC_GENL_VERSION, 44 .version = NFC_GENL_VERSION,
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 194435aa1165..f9fef7dfba15 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -671,7 +671,6 @@ static const struct genl_ops dp_packet_genl_ops[] = {
671}; 671};
672 672
673static struct genl_family dp_packet_genl_family = { 673static struct genl_family dp_packet_genl_family = {
674 .id = GENL_ID_GENERATE,
675 .hdrsize = sizeof(struct ovs_header), 674 .hdrsize = sizeof(struct ovs_header),
676 .name = OVS_PACKET_FAMILY, 675 .name = OVS_PACKET_FAMILY,
677 .version = OVS_PACKET_VERSION, 676 .version = OVS_PACKET_VERSION,
@@ -1436,7 +1435,6 @@ static const struct genl_ops dp_flow_genl_ops[] = {
1436}; 1435};
1437 1436
1438static struct genl_family dp_flow_genl_family = { 1437static struct genl_family dp_flow_genl_family = {
1439 .id = GENL_ID_GENERATE,
1440 .hdrsize = sizeof(struct ovs_header), 1438 .hdrsize = sizeof(struct ovs_header),
1441 .name = OVS_FLOW_FAMILY, 1439 .name = OVS_FLOW_FAMILY,
1442 .version = OVS_FLOW_VERSION, 1440 .version = OVS_FLOW_VERSION,
@@ -1822,7 +1820,6 @@ static const struct genl_ops dp_datapath_genl_ops[] = {
1822}; 1820};
1823 1821
1824static struct genl_family dp_datapath_genl_family = { 1822static struct genl_family dp_datapath_genl_family = {
1825 .id = GENL_ID_GENERATE,
1826 .hdrsize = sizeof(struct ovs_header), 1823 .hdrsize = sizeof(struct ovs_header),
1827 .name = OVS_DATAPATH_FAMILY, 1824 .name = OVS_DATAPATH_FAMILY,
1828 .version = OVS_DATAPATH_VERSION, 1825 .version = OVS_DATAPATH_VERSION,
@@ -2244,7 +2241,6 @@ static const struct genl_ops dp_vport_genl_ops[] = {
2244}; 2241};
2245 2242
2246struct genl_family dp_vport_genl_family = { 2243struct genl_family dp_vport_genl_family = {
2247 .id = GENL_ID_GENERATE,
2248 .hdrsize = sizeof(struct ovs_header), 2244 .hdrsize = sizeof(struct ovs_header),
2249 .name = OVS_VPORT_FAMILY, 2245 .name = OVS_VPORT_FAMILY,
2250 .version = OVS_VPORT_VERSION, 2246 .version = OVS_VPORT_VERSION,
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index 4b94f3cfe3af..383b8fedabc7 100644
--- a/net/tipc/netlink.c
+++ b/net/tipc/netlink.c
@@ -136,7 +136,6 @@ const struct nla_policy tipc_nl_udp_policy[TIPC_NLA_UDP_MAX + 1] = {
136 * so we have a separate genl handling for the new API. 136 * so we have a separate genl handling for the new API.
137 */ 137 */
138struct genl_family tipc_genl_family = { 138struct genl_family tipc_genl_family = {
139 .id = GENL_ID_GENERATE,
140 .name = TIPC_GENL_V2_NAME, 139 .name = TIPC_GENL_V2_NAME,
141 .version = TIPC_GENL_V2_VERSION, 140 .version = TIPC_GENL_V2_VERSION,
142 .hdrsize = 0, 141 .hdrsize = 0,
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 1fd464764765..f04428e4c8e5 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -1216,7 +1216,6 @@ send:
1216} 1216}
1217 1217
1218static struct genl_family tipc_genl_compat_family = { 1218static struct genl_family tipc_genl_compat_family = {
1219 .id = GENL_ID_GENERATE,
1220 .name = TIPC_GENL_NAME, 1219 .name = TIPC_GENL_NAME,
1221 .version = TIPC_GENL_VERSION, 1220 .version = TIPC_GENL_VERSION,
1222 .hdrsize = TIPC_GENL_HDRLEN, 1221 .hdrsize = TIPC_GENL_HDRLEN,
diff --git a/net/wimax/stack.c b/net/wimax/stack.c
index 3f816e2971ee..8ac83a41585f 100644
--- a/net/wimax/stack.c
+++ b/net/wimax/stack.c
@@ -573,7 +573,6 @@ size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL);
573 573
574 574
575struct genl_family wimax_gnl_family = { 575struct genl_family wimax_gnl_family = {
576 .id = GENL_ID_GENERATE,
577 .name = "WiMAX", 576 .name = "WiMAX",
578 .version = WIMAX_GNL_VERSION, 577 .version = WIMAX_GNL_VERSION,
579 .hdrsize = 0, 578 .hdrsize = 0,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7d8cb3330c86..714beafe05e0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -39,7 +39,6 @@ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
39 39
40/* the netlink family */ 40/* the netlink family */
41static struct genl_family nl80211_fam = { 41static struct genl_family nl80211_fam = {
42 .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */
43 .name = NL80211_GENL_NAME, /* have users key off the name instead */ 42 .name = NL80211_GENL_NAME, /* have users key off the name instead */
44 .hdrsize = 0, /* no private header */ 43 .hdrsize = 0, /* no private header */
45 .version = 1, /* no particular meaning now */ 44 .version = 1, /* no particular meaning now */