From 694b78f1533eb72c638c83754e0567630a93f456 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 25 Jun 2018 18:37:56 +0200 Subject: 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 --- backport/compat/backport-4.12.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3