--- mDNSCore/mDNS.c.ORG Mon Jul 24 15:37:04 2006 +++ mDNSCore/mDNS.c Sat Sep 2 15:51:12 2006 @@ -5487,7 +5487,7 @@ { // If record is recent, just ensure the whole RRSet has the same TTL (as required by DNS semantics) // else, if record is old, mark it to be flushed - if (m->timenow - r2->TimeRcvd < mDNSPlatformOneSecond) + if (r2->resrec.rroriginalttl > 1 && m->timenow - r2->TimeRcvd < mDNSPlatformOneSecond) r2->resrec.rroriginalttl = r1->resrec.rroriginalttl; else { --- mDNSPosix/Makefile.ORG Thu Jun 1 13:41:25 2006 +++ mDNSPosix/Makefile Mon Jul 24 15:38:05 2006 @@ -270,7 +270,7 @@ # Configure per-OS peculiarities ifeq ($(os),solaris) -CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \ +CFLAGS_OS = -DHAVE_SOLARIS -DHAVE_IPV6 -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \ -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME CC = gcc LD = gcc -shared @@ -299,9 +299,10 @@ LOCALBASE?=/usr/local INSTBASE=$(LOCALBASE) STARTUPSCRIPTNAME=mdns.sh -CFLAGS_OS = +CFLAGS_OS = -DHAVE_IPV6 JAVACFLAGS_OS += -I$(JDK)/include/freebsd LDCONFIG = ldconfig +OPTIONALTARG = nss_mdns else ifeq ($(os),openbsd) @@ -488,7 +489,9 @@ else $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc2.d/S52mdns $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc3.d/S52mdns +ifneq ($(os),solaris) $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc4.d/S52mdns +endif $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc5.d/S52mdns $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc0.d/K16mdns $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc6.d/K16mdns --- mDNSPosix/PosixDaemon.c.ORG Thu Jun 1 13:41:25 2006 +++ mDNSPosix/PosixDaemon.c Thu Jun 1 13:41:24 2006 @@ -131,11 +131,17 @@ #include #include +#include // bzero() + #include "mDNSEmbeddedAPI.h" #include "mDNSDebug.h" #include "mDNSPosix.h" #include "uds_daemon.h" #include "PlatformCommon.h" + +#ifdef NOT_HAVE_DAEMON +# include "mDNSUNP.h" +#endif #define CONFIG_FILE "/etc/mdnsd.conf" static domainname DynDNSZone; // Default wide-area zone for service registration --- mDNSPosix/mDNSPosix.c.ORG Thu Jun 1 13:41:25 2006 +++ mDNSPosix/mDNSPosix.c Thu Jun 1 13:41:24 2006 @@ -852,7 +852,13 @@ { struct ipv6_mreq imr6; struct sockaddr_in6 bindAddr6; - #if defined(IPV6_PKTINFO) + #if defined(IPV6_RECVPKTINFO) + if (err == 0) + { + err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_RECVPKTINFO, &kOn, sizeof(kOn)); + if (err < 0) { err = errno; perror("setsockopt - IPV6_RECVPKTINFO"); } + } + #elif defined(IPV6_PKTINFO) if (err == 0) { err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_PKTINFO, &kOn, sizeof(kOn)); @@ -861,12 +867,20 @@ #else #warning This platform has no way to get the destination interface information for IPv6 -- will only work for single-homed hosts #endif - #if defined(IPV6_HOPLIMIT) + #if defined(IPV6_RECVHOPLIMIT) + if (err == 0) + { + err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &kOn, sizeof(kOn)); + if (err < 0) { err = errno; perror("setsockopt - IPV6_RECVHOPLIMIT"); } + } + #elif defined(IPV6_HOPLIMIT) if (err == 0) { err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_HOPLIMIT, &kOn, sizeof(kOn)); if (err < 0) { err = errno; perror("setsockopt - IPV6_HOPLIMIT"); } } + #else + #warning This platform has no way to specify the value of hoplimit field of received IP6 hdr #endif // Add multicast group membership on this interface --- mDNSPosix/mDNSUNP.c.ORG Thu Jun 1 13:41:25 2006 +++ mDNSPosix/mDNSUNP.c Thu Jun 1 13:41:25 2006 @@ -153,8 +153,9 @@ #include #endif -#if defined(AF_INET6) && HAVE_IPV6 && !HAVE_LINUX -#include +#if defined(AF_INET6) && HAVE_IPV6 && !HAVE_LINUX && !HAVE_SOLARIS +# include +# include #endif #if defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX --- mDNSShared/uds_daemon.c.ORG Thu Jun 1 13:41:25 2006 +++ mDNSShared/uds_daemon.c Thu Jun 1 13:41:25 2006 @@ -603,6 +603,7 @@ #define dnssd_strerror(X) strerror(X) #endif +#include // bzero() #include #include #include "mDNSEmbeddedAPI.h"