git: 263efa6c4a7b - stable/13 - iscsid: Push #ifdef ICL_KERNEL_PROXY into cap_ioctl_limits list.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 17 May 2022 21:15:54 UTC
The branch stable/13 has been updated by jhb:

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

commit 263efa6c4a7bcd5d0faeee9413a8e10d12c07981
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-18 19:44:36 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-17 21:15:13 +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
    
    (cherry picked from commit f0df72273377daf5e1e97b80a4e542362b261a1d)
---
 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 2689c4a2b455..4204ac495181 100644
--- a/usr.sbin/iscsid/iscsid.c
+++ b/usr.sbin/iscsid/iscsid.c
@@ -466,13 +466,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)