netlink_kernel_create不与最新的Linux内核工作 [英] netlink_kernel_create is not working with latest linux kernel
本文介绍了netlink_kernel_create不与最新的Linux内核工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到编译器错误在编译时我的老这是使用网络链路功能的内核
模块。
INT
的init_module()
{
/ *初始化网络链路内核接口* /
nl_sk = netlink_kernel_create(安培; init_net,17,0,recv_cmd,NULL,THIS_MODULE);
如果(!nl_sk)
{
printk的(KERN_INFO无法初始化系统(错误:1001)\\ n);
返回-ENOMEM;
}
....
previously它工作正常,但现在我得到这个错误。
错误:参数太多的功能netlink_kernel_create
OS信息
的uname -aLinux的ibrar艾哈迈德3.8.0-17泛型#27 Ubuntu的SMP日4月7日19时39分35秒UTC 2013 x86_64的x86_64的x86_64的GNU / Linux的
解决方案
只需更换
nl_sk = netlink_kernel_create(安培; init_net,17,0,recv_cmd,NULL,THIS_MODULE);
具有以下
结构netlink_kernel_cfg CFG = {
。输入= recv_cmd,
};nl_sk = netlink_kernel_create(安培; init_net,17,&安培; CFG);
和它应该工作。我遇到了同样的问题。
I am getting compiler error while compiling my old kernel
module which is using netlink functions.
int
init_module()
{
/* Initialize the Netlink kernel interface */
nl_sk = netlink_kernel_create(&init_net, 17, 0, recv_cmd, NULL, THIS_MODULE);
if(!nl_sk)
{
printk(KERN_INFO "failed to initialize system (error: 1001)\n");
return -ENOMEM;
}
....
Previously it works fine but now I am getting this error.
error: too many arguments to function 'netlink_kernel_create'
OS Information
uname -a
Linux ibrar-ahmed 3.8.0-17-generic #27-Ubuntu SMP Sun Apr 7 19:39:35 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
解决方案
Just replace
nl_sk = netlink_kernel_create(&init_net, 17, 0, recv_cmd, NULL, THIS_MODULE);
with the following
struct netlink_kernel_cfg cfg = {
.input = recv_cmd,
};
nl_sk = netlink_kernel_create(&init_net, 17, &cfg);
and it should work. I ran into the same problems.
这篇关于netlink_kernel_create不与最新的Linux内核工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文