From 71d20c8a1228f15884f3120f6db19798075612e2 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 20 Dec 2014 14:11:38 +0000 Subject: [PATCH] Fix compile on QNX. Thanks to Will Miles. --- configure | 3 +++ if.c | 5 +++++ ipv6.c | 18 ++++++++++-------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/configure b/configure index f250d018..8bad7d8f 100755 --- a/configure +++ b/configure @@ -506,6 +506,9 @@ if $XCC _inet_ntoa.c -o _inet_ntoa 2>&3; then elif $XCC _inet_ntoa.c -lnsl -o _inet_ntoa 2>&3; then echo "yes (-lnsl)" echo "LDADD+= -lnsl" >>$CONFIG_MK +elif $XCC _inet_ntoa.c -lsocket -o _inet_ntoa 2>&3; then + echo "yes (-lsocket)" + echo "LDADD+= -lsocket" >>$CONFIG_MK else echo "no" echo "libc support for inet_ntoa is required - aborting" >&2 diff --git a/if.c b/if.c index 41906447..2bbb4f6c 100644 --- a/if.c +++ b/if.c @@ -70,6 +70,11 @@ #include "ipv4.h" #include "ipv6nd.h" +#ifdef __QNX__ +/* QNX carries defines for, but does not actually support PF_LINK */ +#undef IFLR_ACTIVE +#endif + void if_free(struct interface *ifp) { diff --git a/ipv6.c b/ipv6.c index 6744140b..0ae873a3 100644 --- a/ipv6.c +++ b/ipv6.c @@ -48,15 +48,17 @@ # define IN6_IFF_DUPLICATED 0x08 # endif # define IN6_IFF_DETACHED 0 -#else -# include +#else /* !__linux__ */ +# ifndef __QNX__ +# include +# endif # include -#ifdef __FreeBSD__ /* Needed so that including netinet6/in6_var.h works */ -# include -#endif -#ifndef __sun -# include -#endif +# ifdef __FreeBSD__ /* Needed so that including netinet6/in6_var.h works */ +# include +# endif +# ifndef __sun +# include +# endif #endif #include