]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fix build on Linux systems lacking linux/if_addr.h or IFA_F_TENTATIVE.
authorDave Hart <hart@ntp.org>
Tue, 26 Jul 2011 01:59:51 +0000 (01:59 +0000)
committerDave Hart <hart@ntp.org>
Tue, 26 Jul 2011 01:59:51 +0000 (01:59 +0000)
bk: 4e2e1f971mz9KJKt3DCJiQBa2GWUnQ

lib/isc/unix/interfaceiter.c
sntp/m4/ntp_libntp.m4

index e25397b38f0ab88d3074eb6b4fda130fd4d8ff0f..996669fc91e0917af17274044c3707b5a089531b 100644 (file)
@@ -51,7 +51,7 @@
 #endif
 #include <net/if.h>
 
-#ifdef __linux
+#ifdef HAVE_LINUX_IF_ADDR_H
 # include <linux/if_addr.h>
 #endif
 
@@ -225,8 +225,10 @@ linux_if_inet6_current(isc_interfaceiter_t *iter) {
        ** Ignore DAD addresses --
        ** we can't bind to them until they are resolved
        */
+#ifdef IFA_F_TENTATIVE
        if (flags & IFA_F_TENTATIVE)
                return (ISC_R_IGNORE);
+#endif
 
        for (i = 0; i < 16; i++) {
                unsigned char byte;
index 55157720b66a18a6022a86ebfc0e058672bc27cd..d2eb32786baa9dd18b9ea7bce9ea7422d7e629fc 100644 (file)
@@ -142,6 +142,15 @@ typedef union mpinfou {
     esac
 esac
 
+case "$host" in
+ *-linux*)
+    AC_CHECK_HEADERS([linux/if_addr.h], [], [], [
+       #ifdef HAVE_SYS_SOCKET_H
+       # include <sys/socket.h>
+       #endif
+    ])
+esac
+
 AC_CHECK_HEADERS([arpa/nameser.h sys/param.h sys/time.h sys/timers.h])
 # sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
 AC_CHECK_HEADERS([sys/sysctl.h], [], [], [