diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2024-09-15 05:26:06 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2024-09-15 05:26:06 +0000 |
commit | 9620a3767c0fc291a710c718f583e3166974d80a (patch) | |
tree | 3c463922db069fec206c730420769f4678684b62 /usr.sbin/radiusctl/radiusctl.c | |
parent | 3faea334c1f754566794b5cc2e0efcf677c96080 (diff) |
Add "delete" command to "radiusctl ipcp". Also, send "stop" that was
missing when disconnecting all when acct-{on,off} received.
Diffstat (limited to 'usr.sbin/radiusctl/radiusctl.c')
-rw-r--r-- | usr.sbin/radiusctl/radiusctl.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 <yasuoka@yasuoka.net> * @@ -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; |