netlink: GNEL_ID_GENERATE definition removed from RHEL7.5 kernel library

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












We have a kernel module that was building fine for RedHat family of Linux distribution, until the recent RHEL7.5.



When trying to build on RHEL7.5, we've got an error of:



...error: ‘GENL_ID_GENERATE’ undeclared...



Did some reading, and it seems like this is an change since kernel 4.11+, but RHEL7.5 is based on kernel 3.10+. What happened?



Anyway, I know that the value of GENL_ID_GENERATE is simply 0. But can I used use 0 to replace the macro? Will there be a problem with user mode module to communicate with this kernel module?



Or, what should be the proper way to fix the problem? Any advice?



Thanks and regards,
Weishan







share|improve this question















  • 1




    Were you using this to fill the .id field of a struct genl_family? If so, looking at the git commits it looks like you can omit the .id completely; the patch removed static family IDs for netlink.
    – ErikF
    May 8 at 16:13










  • Thank you, Erik. Yes, that is just to fill the .id field of a struct genl_family. The information you provided is very helpful.
    – Weishan Yang
    May 9 at 10:00










  • Hum... Beside this issue, there's another problem: error: implicit declaration of function ‘genl_register_family_with_ops’ [-Werror=implicit-function-declaration] retval = res_link_genl_register_family_with_ops(&res_link_genl_family, res_link_gnl_ops, ARRAY_SIZE(res_link_gnl_ops)); ^ cc1: some warnings being treated as errors I have made the build pass, by turn off that warning message as error. However, the kernel module I've build cannot be loaded properly. Seems like this is a issue that need to be addressed. Is that because of some DKMS update? Is that to patch the CPU risk?
    – Weishan Yang
    May 9 at 15:03







  • 1




    It's noted in the Linux HOWTO documentation for netlink: "include a reference to your genl_ops struct as an element in the genl_family struct (element .ops), as well as the number of commands (element .n_ops)." Once you indicate that the issue is fixed, I'll make an answer so you can mark it as complete so other people with the same issue can more easily find it :-)
    – ErikF
    May 9 at 16:11










  • Hi Erik, Thank you so much for your help so far. I'm in a more complex situation: our kernel module will need to support different version and distribution of Linux. At beginning, we have the compiler operation: #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30) to define what we do with genl_register_family..., and it is would be logical to add a && (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)). But the recent Kernel update /RHEL update make this changed from 7.4 (3.10.0-693) and 7.5 (3.10.0-862). How can I check the kernel build number (-693 v.s. -862) with pre-compile operation?
    – Weishan Yang
    May 14 at 7:54














up vote
0
down vote

favorite












We have a kernel module that was building fine for RedHat family of Linux distribution, until the recent RHEL7.5.



When trying to build on RHEL7.5, we've got an error of:



...error: ‘GENL_ID_GENERATE’ undeclared...



Did some reading, and it seems like this is an change since kernel 4.11+, but RHEL7.5 is based on kernel 3.10+. What happened?



Anyway, I know that the value of GENL_ID_GENERATE is simply 0. But can I used use 0 to replace the macro? Will there be a problem with user mode module to communicate with this kernel module?



Or, what should be the proper way to fix the problem? Any advice?



Thanks and regards,
Weishan







share|improve this question















  • 1




    Were you using this to fill the .id field of a struct genl_family? If so, looking at the git commits it looks like you can omit the .id completely; the patch removed static family IDs for netlink.
    – ErikF
    May 8 at 16:13










  • Thank you, Erik. Yes, that is just to fill the .id field of a struct genl_family. The information you provided is very helpful.
    – Weishan Yang
    May 9 at 10:00










  • Hum... Beside this issue, there's another problem: error: implicit declaration of function ‘genl_register_family_with_ops’ [-Werror=implicit-function-declaration] retval = res_link_genl_register_family_with_ops(&res_link_genl_family, res_link_gnl_ops, ARRAY_SIZE(res_link_gnl_ops)); ^ cc1: some warnings being treated as errors I have made the build pass, by turn off that warning message as error. However, the kernel module I've build cannot be loaded properly. Seems like this is a issue that need to be addressed. Is that because of some DKMS update? Is that to patch the CPU risk?
    – Weishan Yang
    May 9 at 15:03







  • 1




    It's noted in the Linux HOWTO documentation for netlink: "include a reference to your genl_ops struct as an element in the genl_family struct (element .ops), as well as the number of commands (element .n_ops)." Once you indicate that the issue is fixed, I'll make an answer so you can mark it as complete so other people with the same issue can more easily find it :-)
    – ErikF
    May 9 at 16:11










  • Hi Erik, Thank you so much for your help so far. I'm in a more complex situation: our kernel module will need to support different version and distribution of Linux. At beginning, we have the compiler operation: #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30) to define what we do with genl_register_family..., and it is would be logical to add a && (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)). But the recent Kernel update /RHEL update make this changed from 7.4 (3.10.0-693) and 7.5 (3.10.0-862). How can I check the kernel build number (-693 v.s. -862) with pre-compile operation?
    – Weishan Yang
    May 14 at 7:54












up vote
0
down vote

favorite









up vote
0
down vote

favorite











We have a kernel module that was building fine for RedHat family of Linux distribution, until the recent RHEL7.5.



When trying to build on RHEL7.5, we've got an error of:



...error: ‘GENL_ID_GENERATE’ undeclared...



Did some reading, and it seems like this is an change since kernel 4.11+, but RHEL7.5 is based on kernel 3.10+. What happened?



Anyway, I know that the value of GENL_ID_GENERATE is simply 0. But can I used use 0 to replace the macro? Will there be a problem with user mode module to communicate with this kernel module?



Or, what should be the proper way to fix the problem? Any advice?



Thanks and regards,
Weishan







share|improve this question











We have a kernel module that was building fine for RedHat family of Linux distribution, until the recent RHEL7.5.



When trying to build on RHEL7.5, we've got an error of:



...error: ‘GENL_ID_GENERATE’ undeclared...



Did some reading, and it seems like this is an change since kernel 4.11+, but RHEL7.5 is based on kernel 3.10+. What happened?



Anyway, I know that the value of GENL_ID_GENERATE is simply 0. But can I used use 0 to replace the macro? Will there be a problem with user mode module to communicate with this kernel module?



Or, what should be the proper way to fix the problem? Any advice?



Thanks and regards,
Weishan









share|improve this question










share|improve this question




share|improve this question









asked May 8 at 15:09









Weishan Yang

7218




7218







  • 1




    Were you using this to fill the .id field of a struct genl_family? If so, looking at the git commits it looks like you can omit the .id completely; the patch removed static family IDs for netlink.
    – ErikF
    May 8 at 16:13










  • Thank you, Erik. Yes, that is just to fill the .id field of a struct genl_family. The information you provided is very helpful.
    – Weishan Yang
    May 9 at 10:00










  • Hum... Beside this issue, there's another problem: error: implicit declaration of function ‘genl_register_family_with_ops’ [-Werror=implicit-function-declaration] retval = res_link_genl_register_family_with_ops(&res_link_genl_family, res_link_gnl_ops, ARRAY_SIZE(res_link_gnl_ops)); ^ cc1: some warnings being treated as errors I have made the build pass, by turn off that warning message as error. However, the kernel module I've build cannot be loaded properly. Seems like this is a issue that need to be addressed. Is that because of some DKMS update? Is that to patch the CPU risk?
    – Weishan Yang
    May 9 at 15:03







  • 1




    It's noted in the Linux HOWTO documentation for netlink: "include a reference to your genl_ops struct as an element in the genl_family struct (element .ops), as well as the number of commands (element .n_ops)." Once you indicate that the issue is fixed, I'll make an answer so you can mark it as complete so other people with the same issue can more easily find it :-)
    – ErikF
    May 9 at 16:11










  • Hi Erik, Thank you so much for your help so far. I'm in a more complex situation: our kernel module will need to support different version and distribution of Linux. At beginning, we have the compiler operation: #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30) to define what we do with genl_register_family..., and it is would be logical to add a && (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)). But the recent Kernel update /RHEL update make this changed from 7.4 (3.10.0-693) and 7.5 (3.10.0-862). How can I check the kernel build number (-693 v.s. -862) with pre-compile operation?
    – Weishan Yang
    May 14 at 7:54












  • 1




    Were you using this to fill the .id field of a struct genl_family? If so, looking at the git commits it looks like you can omit the .id completely; the patch removed static family IDs for netlink.
    – ErikF
    May 8 at 16:13










  • Thank you, Erik. Yes, that is just to fill the .id field of a struct genl_family. The information you provided is very helpful.
    – Weishan Yang
    May 9 at 10:00










  • Hum... Beside this issue, there's another problem: error: implicit declaration of function ‘genl_register_family_with_ops’ [-Werror=implicit-function-declaration] retval = res_link_genl_register_family_with_ops(&res_link_genl_family, res_link_gnl_ops, ARRAY_SIZE(res_link_gnl_ops)); ^ cc1: some warnings being treated as errors I have made the build pass, by turn off that warning message as error. However, the kernel module I've build cannot be loaded properly. Seems like this is a issue that need to be addressed. Is that because of some DKMS update? Is that to patch the CPU risk?
    – Weishan Yang
    May 9 at 15:03







  • 1




    It's noted in the Linux HOWTO documentation for netlink: "include a reference to your genl_ops struct as an element in the genl_family struct (element .ops), as well as the number of commands (element .n_ops)." Once you indicate that the issue is fixed, I'll make an answer so you can mark it as complete so other people with the same issue can more easily find it :-)
    – ErikF
    May 9 at 16:11










  • Hi Erik, Thank you so much for your help so far. I'm in a more complex situation: our kernel module will need to support different version and distribution of Linux. At beginning, we have the compiler operation: #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30) to define what we do with genl_register_family..., and it is would be logical to add a && (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)). But the recent Kernel update /RHEL update make this changed from 7.4 (3.10.0-693) and 7.5 (3.10.0-862). How can I check the kernel build number (-693 v.s. -862) with pre-compile operation?
    – Weishan Yang
    May 14 at 7:54







1




1




Were you using this to fill the .id field of a struct genl_family? If so, looking at the git commits it looks like you can omit the .id completely; the patch removed static family IDs for netlink.
– ErikF
May 8 at 16:13




Were you using this to fill the .id field of a struct genl_family? If so, looking at the git commits it looks like you can omit the .id completely; the patch removed static family IDs for netlink.
– ErikF
May 8 at 16:13












Thank you, Erik. Yes, that is just to fill the .id field of a struct genl_family. The information you provided is very helpful.
– Weishan Yang
May 9 at 10:00




Thank you, Erik. Yes, that is just to fill the .id field of a struct genl_family. The information you provided is very helpful.
– Weishan Yang
May 9 at 10:00












Hum... Beside this issue, there's another problem: error: implicit declaration of function ‘genl_register_family_with_ops’ [-Werror=implicit-function-declaration] retval = res_link_genl_register_family_with_ops(&res_link_genl_family, res_link_gnl_ops, ARRAY_SIZE(res_link_gnl_ops)); ^ cc1: some warnings being treated as errors I have made the build pass, by turn off that warning message as error. However, the kernel module I've build cannot be loaded properly. Seems like this is a issue that need to be addressed. Is that because of some DKMS update? Is that to patch the CPU risk?
– Weishan Yang
May 9 at 15:03





Hum... Beside this issue, there's another problem: error: implicit declaration of function ‘genl_register_family_with_ops’ [-Werror=implicit-function-declaration] retval = res_link_genl_register_family_with_ops(&res_link_genl_family, res_link_gnl_ops, ARRAY_SIZE(res_link_gnl_ops)); ^ cc1: some warnings being treated as errors I have made the build pass, by turn off that warning message as error. However, the kernel module I've build cannot be loaded properly. Seems like this is a issue that need to be addressed. Is that because of some DKMS update? Is that to patch the CPU risk?
– Weishan Yang
May 9 at 15:03





1




1




It's noted in the Linux HOWTO documentation for netlink: "include a reference to your genl_ops struct as an element in the genl_family struct (element .ops), as well as the number of commands (element .n_ops)." Once you indicate that the issue is fixed, I'll make an answer so you can mark it as complete so other people with the same issue can more easily find it :-)
– ErikF
May 9 at 16:11




It's noted in the Linux HOWTO documentation for netlink: "include a reference to your genl_ops struct as an element in the genl_family struct (element .ops), as well as the number of commands (element .n_ops)." Once you indicate that the issue is fixed, I'll make an answer so you can mark it as complete so other people with the same issue can more easily find it :-)
– ErikF
May 9 at 16:11












Hi Erik, Thank you so much for your help so far. I'm in a more complex situation: our kernel module will need to support different version and distribution of Linux. At beginning, we have the compiler operation: #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30) to define what we do with genl_register_family..., and it is would be logical to add a && (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)). But the recent Kernel update /RHEL update make this changed from 7.4 (3.10.0-693) and 7.5 (3.10.0-862). How can I check the kernel build number (-693 v.s. -862) with pre-compile operation?
– Weishan Yang
May 14 at 7:54




Hi Erik, Thank you so much for your help so far. I'm in a more complex situation: our kernel module will need to support different version and distribution of Linux. At beginning, we have the compiler operation: #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30) to define what we do with genl_register_family..., and it is would be logical to add a && (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)). But the recent Kernel update /RHEL update make this changed from 7.4 (3.10.0-693) and 7.5 (3.10.0-862). How can I check the kernel build number (-693 v.s. -862) with pre-compile operation?
– Weishan Yang
May 14 at 7:54










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Looking at the git commits for netlink it looks like several changes were made to the structure in version 4.11:



First, you can omit the .id field completely from your initializer in genl_family as Linux has removed static family IDs.



As well, the genl_register_family_with_ops function is not used any more. Instead, as noted in the Linux HOWTO documentation for netlink:




Up to linux 4.10, use genl_register_family_with_ops(). On 4.10 and
later, include a reference to your genl_ops struct as an element in
the genl_family struct (element .ops), as well as the number of
commands (element .n_ops).







share|improve this answer





















  • This resolved my problem of cannot build and load the kernel module successfully for RHEL7.5. What really confused me, is that RedHat has port this part of change to the kernel 3.10.0-862(RHEL7.5). Even worse, they didn't document this change properly, and they even keep using the same the kernel version (3.10.0).
    – Weishan Yang
    May 16 at 8:10










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442571%2fnetlink-gnel-id-generate-definition-removed-from-rhel7-5-kernel-library%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Looking at the git commits for netlink it looks like several changes were made to the structure in version 4.11:



First, you can omit the .id field completely from your initializer in genl_family as Linux has removed static family IDs.



As well, the genl_register_family_with_ops function is not used any more. Instead, as noted in the Linux HOWTO documentation for netlink:




Up to linux 4.10, use genl_register_family_with_ops(). On 4.10 and
later, include a reference to your genl_ops struct as an element in
the genl_family struct (element .ops), as well as the number of
commands (element .n_ops).







share|improve this answer





















  • This resolved my problem of cannot build and load the kernel module successfully for RHEL7.5. What really confused me, is that RedHat has port this part of change to the kernel 3.10.0-862(RHEL7.5). Even worse, they didn't document this change properly, and they even keep using the same the kernel version (3.10.0).
    – Weishan Yang
    May 16 at 8:10














up vote
1
down vote



accepted










Looking at the git commits for netlink it looks like several changes were made to the structure in version 4.11:



First, you can omit the .id field completely from your initializer in genl_family as Linux has removed static family IDs.



As well, the genl_register_family_with_ops function is not used any more. Instead, as noted in the Linux HOWTO documentation for netlink:




Up to linux 4.10, use genl_register_family_with_ops(). On 4.10 and
later, include a reference to your genl_ops struct as an element in
the genl_family struct (element .ops), as well as the number of
commands (element .n_ops).







share|improve this answer





















  • This resolved my problem of cannot build and load the kernel module successfully for RHEL7.5. What really confused me, is that RedHat has port this part of change to the kernel 3.10.0-862(RHEL7.5). Even worse, they didn't document this change properly, and they even keep using the same the kernel version (3.10.0).
    – Weishan Yang
    May 16 at 8:10












up vote
1
down vote



accepted







up vote
1
down vote



accepted






Looking at the git commits for netlink it looks like several changes were made to the structure in version 4.11:



First, you can omit the .id field completely from your initializer in genl_family as Linux has removed static family IDs.



As well, the genl_register_family_with_ops function is not used any more. Instead, as noted in the Linux HOWTO documentation for netlink:




Up to linux 4.10, use genl_register_family_with_ops(). On 4.10 and
later, include a reference to your genl_ops struct as an element in
the genl_family struct (element .ops), as well as the number of
commands (element .n_ops).







share|improve this answer













Looking at the git commits for netlink it looks like several changes were made to the structure in version 4.11:



First, you can omit the .id field completely from your initializer in genl_family as Linux has removed static family IDs.



As well, the genl_register_family_with_ops function is not used any more. Instead, as noted in the Linux HOWTO documentation for netlink:




Up to linux 4.10, use genl_register_family_with_ops(). On 4.10 and
later, include a reference to your genl_ops struct as an element in
the genl_family struct (element .ops), as well as the number of
commands (element .n_ops).








share|improve this answer













share|improve this answer



share|improve this answer











answered May 16 at 7:09









ErikF

2,6711413




2,6711413











  • This resolved my problem of cannot build and load the kernel module successfully for RHEL7.5. What really confused me, is that RedHat has port this part of change to the kernel 3.10.0-862(RHEL7.5). Even worse, they didn't document this change properly, and they even keep using the same the kernel version (3.10.0).
    – Weishan Yang
    May 16 at 8:10
















  • This resolved my problem of cannot build and load the kernel module successfully for RHEL7.5. What really confused me, is that RedHat has port this part of change to the kernel 3.10.0-862(RHEL7.5). Even worse, they didn't document this change properly, and they even keep using the same the kernel version (3.10.0).
    – Weishan Yang
    May 16 at 8:10















This resolved my problem of cannot build and load the kernel module successfully for RHEL7.5. What really confused me, is that RedHat has port this part of change to the kernel 3.10.0-862(RHEL7.5). Even worse, they didn't document this change properly, and they even keep using the same the kernel version (3.10.0).
– Weishan Yang
May 16 at 8:10




This resolved my problem of cannot build and load the kernel module successfully for RHEL7.5. What really confused me, is that RedHat has port this part of change to the kernel 3.10.0-862(RHEL7.5). Even worse, they didn't document this change properly, and they even keep using the same the kernel version (3.10.0).
– Weishan Yang
May 16 at 8:10












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442571%2fnetlink-gnel-id-generate-definition-removed-from-rhel7-5-kernel-library%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay