netlink_kernel_create is not working with latest linux kernel

前端 未结 3 1712
情深已故
情深已故 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:11

        netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg)
    
        struct netlink_kernel_cfg cfg = {
            .groups = SELNLGRP_MAX,
            .flags  = NL_CFG_F_NONROOT_RECV,
        };
    
        selnl = netlink_kernel_create(&init_net, NETLINK_SELINUX, &cfg);
        if (selnl == NULL)
            panic("SELinux:  Cannot create netlink socket.");
    

提交回复
热议问题