From 9620a3767c0fc291a710c718f583e3166974d80a Mon Sep 17 00:00:00 2001 From: YASUOKA Masahiko Date: Sun, 15 Sep 2024 05:26:06 +0000 Subject: Add "delete" command to "radiusctl ipcp". Also, send "stop" that was missing when disconnecting all when acct-{on,off} received. --- usr.sbin/radiusctl/radiusctl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr.sbin/radiusctl/radiusctl.c') diff --git a/usr.sbin/radiusctl/radiusctl.c b/usr.sbin/radiusctl/radiusctl.c index 6b8a4fedbf4..40fec84a223 100644 --- a/usr.sbin/radiusctl/radiusctl.c +++ b/usr.sbin/radiusctl/radiusctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radiusctl.c,v 1.12 2024/07/24 08:27:20 yasuoka Exp $ */ +/* $OpenBSD: radiusctl.c,v 1.13 2024/09/15 05:26:05 yasuoka Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko * @@ -170,6 +170,7 @@ main(int argc, char *argv[]) IMSG_RADIUSD_MODULE_IPCP_MONITOR : IMSG_RADIUSD_MODULE_IPCP_DUMP, 0, 0, -1, iov, niov); break; + case IPCP_DELETE: case IPCP_DISCONNECT: memset(module_name, 0, sizeof(module_name)); strlcpy(module_name, "ipcp", @@ -178,8 +179,10 @@ main(int argc, char *argv[]) iov[niov++].iov_len = RADIUSD_MODULE_NAME_LEN; iov[niov].iov_base = &res->session_seq; iov[niov++].iov_len = sizeof(res->session_seq); - imsg_composev(&ibuf, IMSG_RADIUSD_MODULE_IPCP_DISCONNECT, 0, 0, - -1, iov, niov); + imsg_composev(&ibuf, + (res->action == IPCP_DELETE) + ? IMSG_RADIUSD_MODULE_IPCP_DELETE + : IMSG_RADIUSD_MODULE_IPCP_DISCONNECT, 0, 0, -1, iov, niov); break; } while (ibuf.w.queued) { @@ -199,6 +202,7 @@ main(int argc, char *argv[]) case IPCP_SHOW: case IPCP_DUMP: case IPCP_MONITOR: + case IPCP_DELETE: case IPCP_DISCONNECT: done = ipcp_handle_imsg(res, &imsg, cnt++); break; -- cgit v1.2.3