-/* $OpenBSD: agentx_control.c,v 1.6 2022/08/31 16:17:18 dv Exp $ */
+/* $OpenBSD: agentx_control.c,v 1.7 2024/01/17 10:01:24 claudio Exp $ */
/*
* Copyright (c) 2020 Martijn van Duren <martijn@openbsd.org>
agentx_getsock(struct imsg *imsg)
{
struct timeval tv = AGENTX_RECONNECT_TIMEOUT;
+ int fd;
- if (imsg->fd == -1)
+ fd = imsg_get_fd(imsg);
+ if (fd == -1)
goto retry;
event_del(&(env->sc_agentxev));
- event_set(&(env->sc_agentxev), imsg->fd, EV_READ | EV_PERSIST,
+ event_set(&(env->sc_agentxev), fd, EV_READ | EV_PERSIST,
agentx_sock, env);
event_add(&(env->sc_agentxev), NULL);
- agentx_connect(sa, imsg->fd);
+ agentx_connect(sa, fd);
retry:
evtimer_set(&env->sc_agentxev, agentx_sock, env);
-/* $OpenBSD: config.c,v 1.44 2023/06/25 08:07:38 op Exp $ */
+/* $OpenBSD: config.c,v 1.45 2024/01/17 10:01:24 claudio Exp $ */
/*
* Copyright (c) 2011 - 2014 Reyk Floeter <reyk@openbsd.org>
memcpy(&rlay->rl_conf, p, sizeof(rlay->rl_conf));
s = sizeof(rlay->rl_conf);
- rlay->rl_s = imsg->fd;
+ rlay->rl_s = imsg_get_fd(imsg);
rlay->rl_tls_ca_fd = -1;
rlay->rl_tls_cacert_fd = -1;
switch (crfd.type) {
case RELAY_FD_CERT:
- cert->cert_fd = imsg->fd;
+ cert->cert_fd = imsg_get_fd(imsg);
break;
case RELAY_FD_KEY:
- cert->cert_key_fd = imsg->fd;
+ cert->cert_key_fd = imsg_get_fd(imsg);
break;
case RELAY_FD_OCSP:
- cert->cert_ocsp_fd = imsg->fd;
+ cert->cert_ocsp_fd = imsg_get_fd(imsg);
break;
case RELAY_FD_CACERT:
- rlay->rl_tls_ca_fd = imsg->fd;
+ rlay->rl_tls_ca_fd = imsg_get_fd(imsg);
break;
case RELAY_FD_CAFILE:
- rlay->rl_tls_cacert_fd = imsg->fd;
+ rlay->rl_tls_cacert_fd = imsg_get_fd(imsg);
break;
}
-/* $OpenBSD: proc.c,v 1.44 2023/02/15 20:44:01 tobhe Exp $ */
+/* $OpenBSD: proc.c,v 1.45 2024/01/17 10:01:24 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
case IMSG_CTL_PROCFD:
IMSG_SIZE_CHECK(&imsg, &pf);
memcpy(&pf, imsg.data, sizeof(pf));
- proc_accept(ps, imsg.fd, pf.pf_procid,
+ proc_accept(ps, imsg_get_fd(&imsg), pf.pf_procid,
pf.pf_instance);
break;
default:
enum privsep_procid id, int n)
{
return (proc_compose_imsg(ps, id, n, imsg->hdr.type,
- imsg->hdr.peerid, imsg->fd, imsg->data, IMSG_DATA_SIZE(imsg)));
+ imsg->hdr.peerid, -1, imsg->data, IMSG_DATA_SIZE(imsg)));
}
struct imsgbuf *
-/* $OpenBSD: relay.c,v 1.258 2023/10/29 11:27:11 kn Exp $ */
+/* $OpenBSD: relay.c,v 1.259 2024/01/17 10:01:24 claudio Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
}
/* Will validate the result later */
- con->se_bnds = imsg->fd;
+ con->se_bnds = imsg_get_fd(imsg);
evtimer_del(&con->se_ev);
evtimer_set(&con->se_ev, relay_bindany, con);