git: 79a6ad63e6af - main - libifconfig: Fix table size
Dag-Erling Smørgrav <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.src,gmane.os.freebsd.current.scm |
|---|---|
| Message-ID | <[email protected]> |
The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=79a6ad63e6afdfa00d0e625996bddf91e9f217c3 commit 79a6ad63e6afdfa00d0e625996bddf91e9f217c3 Author: Dag-Erling Smørgrav <[email protected]> AuthorDate: 2026-08-13 21:45:58 +0000 Commit: Dag-Erling Smørgrav <[email protected]> CommitDate: 2026-08-14 00:54:27 +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 --- 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; };