git: fffd648a220d - stable/14 - libifconfig: Fix table size

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Sun, 16 Aug 2026 20:25:20 UTC
The branch stable/14 has been updated by des:

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

commit fffd648a220d0453a9e3a3476980f8cc57cf329a
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-08-13 21:45:58 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-08-16 20:25:00 +0000

    libifconfig: Fix table size
    
    Tables that have one element per protocol or address family were
    previously sized by AF_MAX + 1 since AF_MAX was off by one.  Now that
    AF_MAX has been corrected, we need to apply the opposite correction to
    these tables.
    
    Fixes:          ddd850aa7720 ("sys/socket.h: Fix AF_MAX")
    MFC after:      3 days
    Sponsored by:   Klara, Inc.
    Sponsored by:   NetApp, Inc.
    Reviewed by:    kevans
    Differential Revision:  https://reviews.freebsd.org/D58827
    
    (cherry picked from commit 79a6ad63e6afdfa00d0e625996bddf91e9f217c3)
---
 lib/libifconfig/libifconfig_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libifconfig/libifconfig_internal.h b/lib/libifconfig/libifconfig_internal.h
index 910e90df7d31..64b474db675b 100644
--- a/lib/libifconfig/libifconfig_internal.h
+++ b/lib/libifconfig/libifconfig_internal.h
@@ -49,7 +49,7 @@ struct errstate {
 
 struct ifconfig_handle {
 	struct errstate error;
-	int sockets[AF_MAX + 1];
+	int sockets[AF_MAX];
 	/** Cached output of getifaddrs */
 	struct ifaddrs *ifap;
 };