summaryrefslogtreecommitdiff
path: root/backport
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-06-25 18:37:56 +0200
committerJohannes Berg <johannes.berg@intel.com>2018-06-25 18:37:56 +0200
commit694b78f1533eb72c638c83754e0567630a93f456 (patch)
tree7372129a94d594164cf9199ed1d8bf69d504f2e3 /backport
parentc6e4ad12e850b0251242de8ebc01b649dccf9230 (diff)
backports: genl: fix family->family.id access
If compiling on 3.13, struct genl_family isn't actually struct backport_genl_family, and then family->family doesn't exist. In other cases, it's actually necessary to update it, so add an #ifdef with the same logic as the override from genl_family -> backport_genl_family. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport')
-rw-r--r--backport/compat/backport-4.12.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/backport/compat/backport-4.12.c b/backport/compat/backport-4.12.c
index 4948b531..5fc8c10c 100644
--- a/backport/compat/backport-4.12.c
+++ b/backport/compat/backport-4.12.c
@@ -226,11 +226,13 @@ int bp_extack_genl_register_family(struct genl_family *family)
family->id = copy->family.id;
family->attrbuf = copy->family.attrbuf;
+#if LINUX_VERSION_IS_LESS(3,13,0) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)
/* family ID from the original family struct will be used when building
* genl messages (sent as nlmsg_type), so the new id should be updated
* in the original (older kernel format) family struct too
*/
family->family.id = copy->family.id;
+#endif
#if LINUX_VERSION_IS_GEQ(3,13,0)
family->mcgrp_offset = copy->family.mcgrp_offset;