This commit is contained in:
Yousha Aleayoub 2024-10-30 16:28:25 -07:00 committed by GitHub
commit 76060b61ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,21 +23,23 @@ static struct sock *selnl __ro_after_init;
static int selnl_msglen(int msgtype)
{
int ret = 0;
int ret = 0;
switch (msgtype) {
case SELNL_MSG_SETENFORCE:
ret = sizeof(struct selnl_msg_setenforce);
break;
switch (msgtype) {
case SELNL_MSG_SETENFORCE:
ret = sizeof(struct selnl_msg_setenforce);
break;
case SELNL_MSG_POLICYLOAD:
ret = sizeof(struct selnl_msg_policyload);
break;
case SELNL_MSG_POLICYLOAD:
ret = sizeof(struct selnl_msg_policyload);
break;
default:
BUG();
}
return ret;
default:
pr_err("Unknown message type in selnl_msglen: %d\n", msgtype);
ret = -EINVAL; // Return an error code or appropriate default value
}
return ret;
}
static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *data)