-/* $OpenBSD: rde.c,v 1.612 2023/11/07 11:18:35 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.613 2023/12/14 13:52:37 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
case IMSG_SOCKET_CONN:
case IMSG_SOCKET_CONN_CTL:
case IMSG_SOCKET_CONN_RTR:
- if ((fd = imsg.fd) == -1) {
+ if ((fd = imsg_get_fd(&imsg)) == -1) {
log_warnx("expected to receive imsg fd "
"but didn't receive any");
break;
break;
}
memcpy(&xmrt, imsg.data, sizeof(xmrt));
- if ((fd = imsg.fd) == -1)
+ if ((fd = imsg_get_fd(&imsg)) == -1)
log_warnx("expected to receive fd for mrt dump "
"but didn't receive any");
else if (xmrt.type == MRT_TABLE_DUMP ||
-/* $OpenBSD: rtr.c,v 1.17 2023/11/07 11:18:35 claudio Exp $ */
+/* $OpenBSD: rtr.c,v 1.18 2023/12/14 13:52:38 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
switch (imsg.hdr.type) {
case IMSG_SOCKET_CONN_RTR:
- if ((fd = imsg.fd) == -1) {
+ if ((fd = imsg_get_fd(&imsg)) == -1) {
log_warnx("expected to receive imsg fd "
"but didn't receive any");
break;
imsg_init(ibuf_rde, fd);
break;
case IMSG_SOCKET_CONN:
- if ((fd = imsg.fd) == -1) {
+ if ((fd = imsg_get_fd(&imsg)) == -1) {
log_warnx("expected to receive imsg fd "
"but didn't receive any");
break;
-/* $OpenBSD: session.c,v 1.455 2023/11/07 11:18:35 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.456 2023/12/14 13:52:38 claudio Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
case IMSG_SOCKET_CONN_CTL:
if (idx != PFD_PIPE_MAIN)
fatalx("reconf request not from parent");
- if ((fd = imsg.fd) == -1) {
+ if ((fd = imsg_get_fd(&imsg)) == -1) {
log_warnx("expected to receive imsg fd to "
"RDE but didn't receive any");
break;
fatalx("king bula sez: "
"expected REINIT");
- if ((nla->fd = imsg.fd) == -1)
+ if ((nla->fd = imsg_get_fd(&imsg)) == -1)
log_warnx("expected to receive fd for "
"%s but didn't receive any",
log_sockaddr((struct sockaddr *)
sizeof(restricted))
fatalx("RECONF_CTRL imsg with wrong len");
memcpy(&restricted, imsg.data, sizeof(restricted));
- if (imsg.fd == -1) {
+ if ((fd = imsg_get_fd(&imsg)) == -1) {
log_warnx("expected to receive fd for control "
"socket but didn't receive any");
break;
}
if (restricted) {
control_shutdown(rcsock);
- rcsock = imsg.fd;
+ rcsock = fd;
} else {
control_shutdown(csock);
- csock = imsg.fd;
+ csock = fd;
}
break;
case IMSG_RECONF_DRAIN:
}
memcpy(&xmrt, imsg.data, sizeof(struct mrt));
- if ((xmrt.wbuf.fd = imsg.fd) == -1)
+ if ((xmrt.wbuf.fd = imsg_get_fd(&imsg)) == -1)
log_warnx("expected to receive fd for mrt dump "
"but didn't receive any");