Patches to successfully compile dnsmasq on Solaris. This patch was developed in-house. Since it is Solaris-specific it is not suitable for upstream. diff --git a/src/bpf.c b/src/bpf.c index 82d215a..ed06772 100644 --- a/src/bpf.c +++ b/src/bpf.c @@ -31,7 +31,9 @@ # include #endif #include +#ifndef HAVE_SOLARIS_NETWORK #include +#endif #ifndef SA_SIZE #define SA_SIZE(sa) \ diff --git a/src/config.h b/src/config.h index 9f69ce3..17bf7f1 100644 --- a/src/config.h +++ b/src/config.h @@ -302,7 +302,8 @@ HAVE_SOCKADDR_SA_LEN #define HAVE_GETOPT_LONG #undef HAVE_SOCKADDR_SA_LEN #define ETHER_ADDR_LEN 6 - +#undef HAVE_IPSET + #endif /* rules to implement compile-time option dependencies and diff --git a/src/dnsmasq.h b/src/dnsmasq.h index e770454..2a22bdd 100644 --- a/src/dnsmasq.h +++ b/src/dnsmasq.h @@ -1384,7 +1384,7 @@ int set_ipv6pktinfo(int fd); #ifdef HAVE_DHCP6 void join_multicast(int dienow); #endif -#if defined(HAVE_LINUX_NETWORK) || defined(HAVE_BSD_NETWORK) +#if defined(HAVE_LINUX_NETWORK) || defined(HAVE_BSD_NETWORK) || defined(HAVE_SOLARIS_NETWORK) void newaddress(time_t now); #endif --- a/src/ip6addr.h 2021-09-08 22:21:22.000000000 +0000 +++ b/src/ip6addr.h 2021-11-30 07:27:25.197780519 +0000 @@ -14,8 +14,41 @@ along with this program. If not, see . */ +#ifdef HAVE_SOLARIS_NETWORK +#ifdef _BIG_ENDIAN +#define IN6_IS_ADDR_ULA(a) \ + (((a)->_S6_un._S6_u32[0] & htonl (0x000000ff)) \ + == htonl (0x000000fd)) +#define IN6_IS_ADDR_ULA_ZERO(a) \ + (((a)->_S6_un._S6_u32[0] == htonl (0x000000fd)) \ + && ((a)->_S6_un._S6_u32[1] == 0) \ + && ((a)->_S6_un._S6_u32[2] == 0) \ + && ((a)->_S6_un._S6_u32[3] == 0)) +#define IN6_IS_ADDR_LINK_LOCAL_ZERO(a) \ + (((a)->_S6_un._S6_u32[0] == htonl (0x000080fe)) \ + && ((a)->_S6_un._S6_u32[1] == 0) \ + && ((a)->_S6_un._S6_u32[2] == 0) \ + && ((a)->_S6_un._S6_u32[3] == 0)) +#else /* _BIG_ENDIAN */ +#define IN6_IS_ADDR_ULA(a) \ + (((a)->_S6_un._S6_u32[0] & htonl (0xff000000)) \ + == htonl (0xfd000000)) + +#define IN6_IS_ADDR_ULA_ZERO(a) \ + (((a)->_S6_un._S6_u32[0] == htonl (0xfd000000)) \ + && ((a)->_S6_un._S6_u32[1] == 0) \ + && ((a)->_S6_un._S6_u32[2] == 0) \ + && ((a)->_S6_un._S6_u32[3] == 0)) + +#define IN6_IS_ADDR_LINK_LOCAL_ZERO(a) \ + (((a)->_S6_un._S6_u32[0] == htonl (0xfe800000)) \ + && ((a)->_S6_un._S6_u32[1] == 0) \ + && ((a)->_S6_un._S6_u32[2] == 0) \ + && ((a)->_S6_un._S6_u32[3] == 0)) +#endif /* _BIG_ENDIAN */ +#else /* HAVE_SOLARIS_NETWORK */ #define IN6_IS_ADDR_ULA(a) \ ((((__const uint32_t *) (a))[0] & htonl (0xff000000)) \ == htonl (0xfd000000)) @@ -31,3 +64,5 @@ && ((__const uint32_t *) (a))[1] == 0 \ && ((__const uint32_t *) (a))[2] == 0 \ && ((__const uint32_t *) (a))[3] == 0) + +#endif /* HAVE_SOLARIS_NETWORK */ --- a/bld/pkg-wrapper 2021-09-08 22:21:22.000000000 +0000 +++ b/bld/pkg-wrapper 2021-12-03 04:27:45.325925557 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash in=`cat` --- a/src/dump.c 2023-05-11 17:40:27.341715910 +0200 +++ b/src/dump.c 2023-05-11 17:44:17.810574531 +0200 @@ -20,6 +20,8 @@ #include +#define IPDEFTTL 64 /* default ttl, RFC 1122, RFC 1340 */ + static u32 packet_count; static void do_dump_packet(int mask, void *packet, size_t len, union mysockaddr *src, union mysockaddr *dst, int port, int proto);