-/* $OpenBSD: kdump.c,v 1.149 2022/07/20 05:56:36 deraadt Exp $ */
+/* $OpenBSD: kdump.c,v 1.150 2022/09/08 16:04:31 mbuhl Exp $ */
/*-
* Copyright (c) 1988, 1993
[SYS_ptrace] = { Ptracedecode, Ppid_t, Pptr, Pdecint },
[SYS_recvmsg] = { Pfd, Pptr, Sendrecvflagsname },
[SYS_sendmsg] = { Pfd, Pptr, Sendrecvflagsname },
+ [SYS_recvmmsg] = { Pfd, Pptr, Pucount, Sendrecvflagsname, Pptr },
+ [SYS_sendmmsg] = { Pfd, Pptr, Pucount, Sendrecvflagsname },
[SYS_recvfrom] = { Pfd, Pptr, Pbigsize, Sendrecvflagsname },
[SYS_accept] = { Pfd, Pptr, Pptr },
[SYS_getpeername] = { Pfd, Pptr, Pptr },
-/* $OpenBSD: ktrstruct.c,v 1.29 2020/12/21 07:47:37 otto Exp $ */
+/* $OpenBSD: ktrstruct.c,v 1.30 2022/09/08 16:04:31 mbuhl Exp $ */
/*-
* Copyright (c) 1988, 1993
printf(" }\n");
}
+static void
+ktrmmsghdr(const struct mmsghdr *mmsg)
+{
+ printf("struct mmsghdr { msg_hdr = { name=%p, namelen=%u, "
+ "iov=%p, iovlen=%u, control=%p, controllen=%u, flags=",
+ mmsg->msg_hdr.msg_name, mmsg->msg_hdr.msg_namelen,
+ mmsg->msg_hdr.msg_iov, mmsg->msg_hdr.msg_iovlen,
+ mmsg->msg_hdr.msg_control, mmsg->msg_hdr.msg_controllen);
+ sendrecvflagsname(mmsg->msg_hdr.msg_flags);
+ printf(" }, msg_len = %u }\n", mmsg->msg_len);
+}
+
static void
ktrmsghdr(const struct msghdr *msg)
{
goto invalid;
memcpy(&msg, data, datalen);
ktrmsghdr(&msg);
+ } else if (strcmp(name, "mmsghdr") == 0) {
+ struct mmsghdr mmsg;
+
+ if (datalen != sizeof(mmsg))
+ goto invalid;
+ memcpy(&mmsg, data, datalen);
+ ktrmmsghdr(&mmsg);
} else if (strcmp(name, "iovec") == 0) {
if (datalen % sizeof(struct iovec))
goto invalid;