diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-01-16 13:33:14 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-01-16 13:33:14 +0000 |
commit | ba8750f70f432266c0e551aa64b476084bda3079 (patch) | |
tree | aa8fd36c27ed1dcb759f3587585738293077bf1d /usr.sbin/snmpd | |
parent | afe86da2d32c8b6d8aff794e7eb49e6b9d7cca20 (diff) |
Convert to imsg_get_fd() and remove unused proc_forward_imsg().
OK martijn@
Diffstat (limited to 'usr.sbin/snmpd')
-rw-r--r-- | usr.sbin/snmpd/proc.c | 12 | ||||
-rw-r--r-- | usr.sbin/snmpd/snmpd.h | 4 | ||||
-rw-r--r-- | usr.sbin/snmpd/snmpe.c | 4 |
3 files changed, 5 insertions, 15 deletions
diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c index 94a78a9a778..941857b7124 100644 --- a/usr.sbin/snmpd/proc.c +++ b/usr.sbin/snmpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.29 2023/12/21 12:43:31 martijn Exp $ */ +/* $OpenBSD: proc.c,v 1.30 2024/01/16 13:33:12 claudio Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org> @@ -644,7 +644,7 @@ proc_dispatch(int fd, short event, void *arg) 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: @@ -770,14 +770,6 @@ proc_composev(struct privsep *ps, enum privsep_procid id, return (proc_composev_imsg(ps, id, -1, type, -1, -1, iov, iovcnt)); } -int -proc_forward_imsg(struct privsep *ps, struct imsg *imsg, - 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))); -} - struct imsgbuf * proc_ibuf(struct privsep *ps, enum privsep_procid id, int n) { diff --git a/usr.sbin/snmpd/snmpd.h b/usr.sbin/snmpd/snmpd.h index 8582abe017f..a25ad588083 100644 --- a/usr.sbin/snmpd/snmpd.h +++ b/usr.sbin/snmpd/snmpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpd.h,v 1.116 2023/12/21 13:54:05 martijn Exp $ */ +/* $OpenBSD: snmpd.h,v 1.117 2024/01/16 13:33:12 claudio Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org> @@ -506,8 +506,6 @@ int proc_composev_imsg(struct privsep *, enum privsep_procid, int, u_int16_t, u_int32_t, int, const struct iovec *, int); int proc_composev(struct privsep *, enum privsep_procid, uint16_t, const struct iovec *, int); -int proc_forward_imsg(struct privsep *, struct imsg *, - enum privsep_procid, int); struct imsgbuf * proc_ibuf(struct privsep *, enum privsep_procid, int); struct imsgev * diff --git a/usr.sbin/snmpd/snmpe.c b/usr.sbin/snmpd/snmpe.c index 73e25ba32a0..055d11724d7 100644 --- a/usr.sbin/snmpd/snmpe.c +++ b/usr.sbin/snmpd/snmpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpe.c,v 1.93 2023/12/21 12:43:31 martijn Exp $ */ +/* $OpenBSD: snmpe.c,v 1.94 2024/01/16 13:33:13 claudio Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org> @@ -138,7 +138,7 @@ snmpe_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg) { switch (imsg->hdr.type) { case IMSG_AX_FD: - appl_agentx_backend(imsg->fd); + appl_agentx_backend(imsg_get_fd(imsg)); return 0; default: return -1; |