commands: send ENOSYS response

parent c071c112
...@@ -1616,6 +1616,16 @@ static int lxc_cmd_get_limiting_cgroup2_fd_callback(int fd, ...@@ -1616,6 +1616,16 @@ static int lxc_cmd_get_limiting_cgroup2_fd_callback(int fd,
true); true);
} }
static int lxc_cmd_rsp_send_enosys(int fd, int id)
{
struct lxc_cmd_rsp rsp = {
.ret = -ENOSYS,
};
__lxc_cmd_rsp_send(fd, &rsp);
return syserrno_set(-ENOSYS, "Invalid command id %d", id);
}
static int lxc_cmd_process(int fd, struct lxc_cmd_req *req, static int lxc_cmd_process(int fd, struct lxc_cmd_req *req,
struct lxc_handler *handler, struct lxc_handler *handler,
struct lxc_epoll_descr *descr) struct lxc_epoll_descr *descr)
...@@ -1651,7 +1661,7 @@ static int lxc_cmd_process(int fd, struct lxc_cmd_req *req, ...@@ -1651,7 +1661,7 @@ static int lxc_cmd_process(int fd, struct lxc_cmd_req *req,
}; };
if (req->cmd >= LXC_CMD_MAX) if (req->cmd >= LXC_CMD_MAX)
return log_trace_errno(-1, EINVAL, "Invalid command id %d", req->cmd); return lxc_cmd_rsp_send_enosys(fd, req->cmd);
return cb[req->cmd](fd, req, handler, descr); return cb[req->cmd](fd, req, handler, descr);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment