backports: update id field in backports genl family
authorAaron Komisar <aaron.komisar@tandemg.com>
Thu, 24 May 2018 10:57:33 +0000 (13:57 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 4 Jun 2018 21:13:00 +0000 (23:13 +0200)
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

Signed-off-by: Aaron Komisar <aaron.komisar@tandemg.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/compat/backport-4.12.c

index 2372a118c82dff27e28812364d55b9276e526caf..4948b531daabeb5987b77f09816926c748e4fb10 100644 (file)
@@ -225,6 +225,13 @@ int bp_extack_genl_register_family(struct genl_family *family)
        /* copy this since the family might access it directly */
        family->id = copy->family.id;
        family->attrbuf = copy->family.attrbuf;
+
+       /* 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;
+
 #if LINUX_VERSION_IS_GEQ(3,13,0)
        family->mcgrp_offset = copy->family.mcgrp_offset;
 #endif