git: 83c23b6c6630 - stable/14 - ipfw: fix dump_soptcodes() handler

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

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

commit 83c23b6c66303157f1bc9f06438b61d70088d849
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:17:37 +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 2d9a1c6d62fd..0502653c8c1b 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -3134,7 +3134,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];