git: f0df72273377 - main - iscsid: Push #ifdef ICL_KERNEL_PROXY into cap_ioctl_limits list.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 18 Apr 2022 19:53:44 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=f0df72273377daf5e1e97b80a4e542362b261a1d

commit f0df72273377daf5e1e97b80a4e542362b261a1d
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-18 19:44:36 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-18 19:53:15 +0000

    iscsid: Push #ifdef ICL_KERNEL_PROXY into cap_ioctl_limits list.
    
    This reduces duplication in the two lists and makes it clearer which
    ioctls are needed in the ICL_KERNEL_PROXY case.
    
    Reviewed by:    mav
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D34927
---
 usr.sbin/iscsid/iscsid.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/usr.sbin/iscsid/iscsid.c b/usr.sbin/iscsid/iscsid.c
index d08a11c90eeb..5555ffccbf7c 100644
--- a/usr.sbin/iscsid/iscsid.c
+++ b/usr.sbin/iscsid/iscsid.c
@@ -496,13 +496,18 @@ static void
 capsicate(struct iscsid_connection *conn)
 {
 	cap_rights_t rights;
+	const unsigned long cmds[] = {
 #ifdef ICL_KERNEL_PROXY
-	const unsigned long cmds[] = { ISCSIDCONNECT, ISCSIDSEND, ISCSIDRECEIVE,
-	    ISCSIDHANDOFF, ISCSIDFAIL, ISCSISADD, ISCSISREMOVE, ISCSISMODIFY };
-#else
-	const unsigned long cmds[] = { ISCSIDHANDOFF, ISCSIDFAIL, ISCSISADD,
-	    ISCSISREMOVE, ISCSISMODIFY };
+		ISCSIDCONNECT,
+		ISCSIDSEND,
+		ISCSIDRECEIVE,
 #endif
+		ISCSIDHANDOFF,
+		ISCSIDFAIL,
+		ISCSISADD,
+		ISCSISREMOVE,
+		ISCSISMODIFY
+	};
 
 	cap_rights_init(&rights, CAP_IOCTL);
 	if (caph_rights_limit(conn->conn_iscsi_fd, &rights) < 0)