summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-09-15 15:18:24 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-09-15 15:18:24 +0000
commitd455860c783f11a6306ce1b0fe396cef8937f731 (patch)
tree7dedd8fe1c688d833ec8e316b686fb8069eb14b4 /sbin
parent27af9ab1ae1c51c43f8b8360063af174b1da29bd (diff)
Rewrite and simplify dhcpleasectl(8).
With this dhcpleasectl em0 does the same as dhclient em0 used to do. To please people's muscle memory one can be aliased to the other. earlier version OK benno with lots of help massaging the output & OK deraadt
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhcpleased/engine.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c
index 3e28c638d44..40574ef1aa2 100644
--- a/sbin/dhcpleased/engine.c
+++ b/sbin/dhcpleased/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.26 2021/09/15 06:08:01 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.27 2021/09/15 15:18:23 florian Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -591,16 +591,11 @@ engine_showinfo_ctl(struct imsg *imsg, uint32_t if_index)
switch (imsg->hdr.type) {
case IMSG_CTL_SHOW_INTERFACE_INFO:
- if (if_index == 0) {
- LIST_FOREACH (iface, &dhcpleased_interfaces, entries)
- send_interface_info(iface, imsg->hdr.pid);
- } else {
- if ((iface = get_dhcpleased_iface_by_id(if_index)) !=
- NULL)
- send_interface_info(iface, imsg->hdr.pid);
- }
- engine_imsg_compose_frontend(IMSG_CTL_END, imsg->hdr.pid, NULL,
- 0);
+ if ((iface = get_dhcpleased_iface_by_id(if_index)) != NULL)
+ send_interface_info(iface, imsg->hdr.pid);
+ else
+ engine_imsg_compose_frontend(IMSG_CTL_END,
+ imsg->hdr.pid, NULL, 0);
break;
default:
log_debug("%s: error handling imsg", __func__);