git: f1929835f76d - stable/13 - ipfw: fix dump_soptcodes() handler

From: Andrey V. Elsukov <ae_at_FreeBSD.org>
Date: Thu, 13 Mar 2025 10:19:06 UTC
The branch stable/13 has been updated by ae:

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

commit f1929835f76d587804c417f19188f41b77e8e7c6
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2025-03-05 09:29:22 +0000
Commit:     Andrey V. Elsukov <ae@FreeBSD.org>
CommitDate: 2025-03-13 10:18:44 +0000

    ipfw: fix dump_soptcodes() handler
    
    Use correct indent number to dump registered socket options.
    It is not currently in use but can be used for debugging.
    
    PR:             283970
    
    (cherry picked from commit b405250c77e6841a8159a4081d4e0f61e49dfbf8)
---
 sys/netpfil/ipfw/ip_fw_sockopt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index 92fcf729a3ae..975a5aabfa25 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -3122,7 +3122,7 @@ dump_soptcodes(struct ip_fw_chain *chain, ip_fw3_opheader *op3,
 	}
 	olh->size = size;
 
-	for (n = 1; n <= count; n++) {
+	for (n = 0; n < count; n++) {
 		i = (ipfw_sopt_info *)ipfw_get_sopt_space(sd, sizeof(*i));
 		KASSERT(i != NULL, ("previously checked buffer is not enough"));
 		sh = &ctl3_handlers[n];