refactor: Drop unneeded `<sys/types.h>` include before `<ifaddrs.h>`
What changed, and why it matters
This commit simply removes an unnecessary C system header include (`<sys/types.h>`) from two files that already include `<ifaddrs.h>`. It is a code cleanup with no functional change and no security relevance.
No security action needed. Treat as ordinary code hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch drops #include <sys/types.h> before #include <ifaddrs.h> in src/common/netif.cpp and in a CMake compile-check source snippet. The commit message explains that getifaddrs()/freeifaddrs() and the surrounding struct ifaddrs usage do not require symbols from <sys/types.h>. This is a refactor; no executable logic, interfaces, or build behavior change in a security-relevant way.
Changed components
src/common/netif.cppcmake/module/TestAppendRequiredLibraries.cmakeInspect captured patch +0 / −2
diff --git a/cmake/module/TestAppendRequiredLibraries.cmake b/cmake/module/TestAppendRequiredLibraries.cmake
index 1fc339a9..2ca5e4b4 100644
--- a/cmake/module/TestAppendRequiredLibraries.cmake
+++ b/cmake/module/TestAppendRequiredLibraries.cmake
@@ -15,7 +15,6 @@ function(test_append_socket_library target)
endif()
set(check_socket_source "
- #include <sys/types.h>
#include <ifaddrs.h>
int main() {
diff --git a/src/common/netif.cpp b/src/common/netif.cpp
index af69b8d1..8de3d819 100644
--- a/src/common/netif.cpp
+++ b/src/common/netif.cpp
@@ -30,7 +30,6 @@
#endif
#ifdef HAVE_IFADDRS
-#include <sys/types.h>
#include <ifaddrs.h>
#endif
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.