refactor: Drop support for FreeBSD < 14
What changed, and why it matters
This is a cleanup change that removes support for older FreeBSD versions (before 14.0) from a single networking source file. It does not fix a security bug, add new behavior, or change how Bitcoin Core runs on currently supported systems. The only practical effect is that the code no longer contains special handling for FreeBSD 13.x, which is no longer a supported operating system release.
No security action needed. Treat as routine maintenance/refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors src/common/netif.cpp by removing the osreldate.h include and the __FreeBSD_version >= 1400000 preprocessor guard. Because Bitcoin Core now only supports FreeBSD 14.4 and 15.1, the netlink-based route lookup code is compiled unconditionally on FreeBSD. There is no functional change on supported platforms; the change merely deletes dead compatibility code for an unsupported OS version.
Changed components
src/common/netif.cppInspect captured patch +2 / −7
diff --git a/src/common/netif.cpp b/src/common/netif.cpp
index 489ed900..cf4a01ff 100644
--- a/src/common/netif.cpp
+++ b/src/common/netif.cpp
@@ -15,11 +15,8 @@
#if defined(__linux__)
#include <linux/rtnetlink.h>
#elif defined(__FreeBSD__)
-#include <osreldate.h>
-#if __FreeBSD_version >= 1400000
#include <netlink/netlink.h>
#include <netlink/netlink_route.h>
-#endif
#elif defined(WIN32)
#include <iphlpapi.h>
#elif defined(__APPLE__)
@@ -60,10 +57,8 @@ std::optional<CNetAddr> FromSockAddr(const struct sockaddr* addr, std::optional<
return std::nullopt;
}
-// Linux and FreeBSD 14.0+. For FreeBSD 13.2 the code can be compiled but
-// running it requires loading a special kernel module, otherwise socket(AF_NETLINK,...)
-// will fail, so we skip that.
-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 1400000)
+// Linux and FreeBSD.
+#if defined(__linux__) || defined(__FreeBSD__)
// Good for responses containing ~ 10,000-15,000 routes.
static constexpr ssize_t NETLINK_MAX_RESPONSE_SIZE{1'048'576};
Why this scored 16/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.