From 2ab97847dfbd84ebba549f53fa2b414a642c37b8 Mon Sep 17 00:00:00 2001 From: dv Date: Sun, 11 Apr 2021 18:53:23 +0000 Subject: [PATCH] Remove dead code for unused IMSG_CTL_NOTIFY messages. Some vestigial code left over from when priv-sep was implemented. ok mlarkin@ --- usr.sbin/vmd/control.c | 27 +-------------------------- usr.sbin/vmd/proc.h | 7 +------ 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/usr.sbin/vmd/control.c b/usr.sbin/vmd/control.c index e5fe3b86fbc..50139daf9d3 100644 --- a/usr.sbin/vmd/control.c +++ b/usr.sbin/vmd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.32 2020/09/23 19:18:18 martijn Exp $ */ +/* $OpenBSD: control.c,v 1.33 2021/04/11 18:53:23 dv Exp $ */ /* * Copyright (c) 2010-2015 Reyk Floeter @@ -48,7 +48,6 @@ struct ctl_conn void control_close(int, struct control_sock *); void control_dispatch_imsg(int, short, void *); int control_dispatch_vmd(int, struct privsep_proc *, struct imsg *); -void control_imsg_forward(struct imsg *); void control_run(struct privsep *, struct privsep_proc *, void *); static struct privsep_proc procs[] = { @@ -357,19 +356,7 @@ control_dispatch_imsg(int fd, short event, void *arg) break; } - control_imsg_forward(&imsg); - switch (imsg.hdr.type) { - case IMSG_CTL_NOTIFY: - if (c->flags & CTL_CONN_NOTIFY) { - log_debug("%s: " - "client requested notify more than once", - __func__); - ret = EINVAL; - goto fail; - } - c->flags |= CTL_CONN_NOTIFY; - break; case IMSG_CTL_VERBOSE: if (IMSG_DATA_SIZE(&imsg) < sizeof(v)) goto fail; @@ -459,15 +446,3 @@ control_dispatch_imsg(int fd, short event, void *arg) imsg_flush(&c->iev.ibuf); control_close(fd, cs); } - -void -control_imsg_forward(struct imsg *imsg) -{ - struct ctl_conn *c; - - TAILQ_FOREACH(c, &ctl_conns, entry) - if (c->flags & CTL_CONN_NOTIFY) - imsg_compose_event(&c->iev, imsg->hdr.type, - imsg->hdr.peerid, imsg->hdr.pid, -1, imsg->data, - imsg->hdr.len - IMSG_HEADER_SIZE); -} diff --git a/usr.sbin/vmd/proc.h b/usr.sbin/vmd/proc.h index b14ca9f5d92..454d5b07276 100644 --- a/usr.sbin/vmd/proc.h +++ b/usr.sbin/vmd/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.17 2021/01/27 07:21:54 deraadt Exp $ */ +/* $OpenBSD: proc.h,v 1.18 2021/04/11 18:53:23 dv Exp $ */ /* * Copyright (c) 2010-2015 Reyk Floeter @@ -32,7 +32,6 @@ enum { IMSG_CTL_FAIL, IMSG_CTL_VERBOSE, IMSG_CTL_END, - IMSG_CTL_NOTIFY, IMSG_CTL_RESET, IMSG_CTL_PROCFD, IMSG_PROC_MAX @@ -71,12 +70,8 @@ TAILQ_HEAD(control_socks, control_sock); struct ctl_conn { TAILQ_ENTRY(ctl_conn) entry; - uint8_t flags; - unsigned int waiting; -#define CTL_CONN_NOTIFY 0x01 struct imsgev iev; struct sockpeercred peercred; - }; TAILQ_HEAD(ctl_connlist, ctl_conn); extern struct ctl_connlist ctl_conns; -- 2.20.1