pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41941?usp=email )
Change subject: core: guard Linux netlink headers by libmnl usage ......................................................................
core: guard Linux netlink headers by libmnl usage
Only include Linux-specific netlink headers when the libmnl backend is enabled.
The code paths requiring <linux/if_link.h> and <linux/rtnetlink.h> are entirely guarded by ENABLE_LIBMNL conditionals, so the headers should not be included unconditionally.
This avoids pulling in Linux-only headers when the corresponding backend is not built.
Change-Id: I0b681deb1f1e025e3ea9996f19b1de06a5feb408 --- M src/core/netdev.c 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/core/netdev.c b/src/core/netdev.c index 1e886f9..7e5a409 100644 --- a/src/core/netdev.c +++ b/src/core/netdev.c @@ -82,6 +82,8 @@ #include <net/if.h> #include <net/route.h>
+#if ENABLE_LIBMNL + #if defined(__linux__) #include <linux/if_link.h> #include <linux/rtnetlink.h> @@ -89,6 +91,8 @@ #error "Unknown platform!" #endif
+#endif /* ENABLE_LIBMNL */ + #include <osmocom/core/utils.h> #include <osmocom/core/select.h> #include <osmocom/core/linuxlist.h>