Hi Simon,

90b24858 causes build regressions when HAVE_LINUX_NETWORK is undefined because then netlink_warn is undefined and you cannot therefore cast it to void to suppress the warning, and get an error instead of a dnsmasq.o file.

The attached patch fixes compilation on FreeBSD.

--
Matthias Andree
From e4bc90ee0fa1f049a0892cd8cd72aa49dee0d2fd Mon Sep 17 00:00:00 2001
From: Matthias Andree <matthias.and...@gmx.de>
Date: Sat, 24 May 2025 21:33:16 +0200
Subject: [PATCH] Unbreak compilation on non-Linux systems (FreeBSD)

and put the void cast of netlink_warn under the same preprocessor
condition as its definition, #ifdef HAVE_LINUX_NETWORK.
---
 src/dnsmasq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 4c70236..62a9e59 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -81,7 +81,9 @@ int main (int argc, char **argv)
   int tftp_prefix_missing = 0;
 #endif
 
+#ifdef HAVE_LINUX_NETWORK
   (void)netlink_warn;
+#endif
   
 #if defined(HAVE_IDN) || defined(HAVE_LIBIDN2) || defined(LOCALEDIR)
   setlocale(LC_ALL, "");
-- 
2.49.0

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to