netlink: GNEL_ID_GENERATE definition removed from RHEL7.5 kernel library
Clash 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
linux kernel ipc
 |Â
show 3 more comments
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
linux kernel ipc
1
Were you using this to fill the.id
field of astruct genl_family
? If so, looking at thegit
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
 |Â
show 3 more comments
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
linux kernel ipc
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
linux kernel ipc
asked May 8 at 15:09
Weishan Yang
7218
7218
1
Were you using this to fill the.id
field of astruct genl_family
? If so, looking at thegit
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
 |Â
show 3 more comments
1
Were you using this to fill the.id
field of astruct genl_family
? If so, looking at thegit
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
 |Â
show 3 more comments
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 yourgenl_ops
struct as an element in
thegenl_family
struct (element.ops
), as well as the number of
commands (element.n_ops
).
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
add a comment |Â
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 yourgenl_ops
struct as an element in
thegenl_family
struct (element.ops
), as well as the number of
commands (element.n_ops
).
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
add a comment |Â
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 yourgenl_ops
struct as an element in
thegenl_family
struct (element.ops
), as well as the number of
commands (element.n_ops
).
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
add a comment |Â
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 yourgenl_ops
struct as an element in
thegenl_family
struct (element.ops
), as well as the number of
commands (element.n_ops
).
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 yourgenl_ops
struct as an element in
thegenl_family
struct (element.ops
), as well as the number of
commands (element.n_ops
).
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Were you using this to fill the
.id
field of astruct genl_family
? If so, looking at thegit
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