netlink_kernel_create is not working with latest linux kernel

前端 未结 3 1646
情深已故
情深已故 2021-02-04 11:28

I am getting compiler error while compiling my old kernel module which is using netlink functions.

int
init_module()
{
    /* Initialize the Netlin         


        
3条回答
  •  走了就别回头了
    2021-02-04 12:19

    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.

提交回复
热议问题