Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to compile with kernel >= 5.2.0 #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions srext/kernel/sr_genl.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ char *err_str[] = {"SREXT answers: OK.",
"SREXT answers: [ERROR]: Table doesn't exist."
};

static struct genl_family sr_gnl_family = {
//.id = GENL_ID_GENERATE,
//.id = 0,
.hdrsize = 0,
.name = SR_GNL_FAMILY_NAME,
.version = SR_GNL_FAMILY_VERSION,
.maxattr = SR_A_MAX,
};

static struct nla_policy sr_genl_policy[_SR_A_MAX + 1] = {
[SR_A_UNSPEC] = { .type = NLA_STRING },
[SR_A_TABLE] = { .type = NLA_STRING },
Expand All @@ -64,6 +55,16 @@ static struct nla_policy sr_genl_policy[_SR_A_MAX + 1] = {
[SR_A_RESPONSE_LST] = { .type = NLA_STRING }
};

static struct genl_family sr_gnl_family = {
//.id = GENL_ID_GENERATE,
//.id = 0,
.hdrsize = 0,
.name = SR_GNL_FAMILY_NAME,
.version = SR_GNL_FAMILY_VERSION,
.maxattr = SR_A_MAX,
.policy = sr_genl_policy,
};

static void set_msg_data(struct genl_msg_data *msg_data, int type,
void *data, int len)
{
Expand Down Expand Up @@ -584,35 +585,30 @@ static struct genl_ops nvf_genl_ops[] = {
{
.cmd = SR_C_ADD,
.flags = 0,
.policy = sr_genl_policy,
.doit = sr_genl_dispatcher,
.dumpit = NULL,
},
{
.cmd = SR_C_DEL,
.flags = 0,
.policy = sr_genl_policy,
.doit = sr_genl_dispatcher,
.dumpit = NULL,
},
{
.cmd = SR_C_SHOW,
.flags = 0,
.policy = sr_genl_policy,
.doit = sr_genl_dispatcher,
.dumpit = NULL,
},
{
.cmd = SR_C_FLUSH,
.flags = 0,
.policy = sr_genl_policy,
.doit = sr_genl_dispatcher,
.dumpit = NULL,
},
{
.cmd = SR_C_CLEAR,
.flags = 0,
.policy = sr_genl_policy,
.doit = sr_genl_dispatcher,
.dumpit = NULL,
}
Expand Down