From 0f3210b3a7fac2cb247986dae4d68040222cdb33 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 27 Dec 2023 10:11:19 -0800 Subject: [PATCH] ctladm: Only autoload cfiscsi.ko for iSCSI-specific commands Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D42935 --- usr.sbin/ctladm/ctladm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 49938be9282a..9d2f14de28ed 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -4144,10 +4144,16 @@ main(int argc, char **argv) goto bailout; } #ifdef WANT_ISCSI - else { + switch (command) { + case CTLADM_CMD_ISLIST: + case CTLADM_CMD_ISLOGOUT: + case CTLADM_CMD_ISTERMINATE: if (modfind("cfiscsi") == -1 && kldload("cfiscsi") == -1) warn("couldn't load cfiscsi"); + break; + default: + break; } #endif } else if ((command != CTLADM_CMD_HELP)