diff options
-rw-r--r-- | net/mDNSResponder/Makefile | 8 | ||||
-rw-r--r-- | net/mDNSResponder/distinfo | 3 | ||||
-rw-r--r-- | net/mDNSResponder/patches/patch-ab | 82 |
3 files changed, 91 insertions, 2 deletions
diff --git a/net/mDNSResponder/Makefile b/net/mDNSResponder/Makefile index f45e98caf98..2e0a6643d21 100644 --- a/net/mDNSResponder/Makefile +++ b/net/mDNSResponder/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.20 2006/03/04 21:30:20 jlam Exp $ +# $NetBSD: Makefile,v 1.21 2006/07/11 14:39:29 drochner Exp $ DISTNAME= mDNSResponder-108 +PKGREVISION= 1 CATEGORIES= net MASTER_SITES= http://darwinsource.opendarwin.org/tarballs/apsl/ @@ -57,6 +58,11 @@ MAKE_ENV+= EXTRA_LIBS=-Wl,-R${BUILDLINK_PREFIX.librfuncs:Q}/lib\ ${BUILDLINK_LDF MAKE_ENV+= EXTRA_LIBS= .endif +BUILD_DEFS+= USE_INET6 +.if defined(USE_INET6) && ${USE_INET6} == "YES" +MAKE_ENV+= HAVE_IPV6=1 +.endif + do-install: for i in ${BINARY}; do \ ${INSTALL_PROGRAM} ${BUILDDIR}/$$i ${PREFIX}/bin; \ diff --git a/net/mDNSResponder/distinfo b/net/mDNSResponder/distinfo index a6718df82b1..2cc14acd385 100644 --- a/net/mDNSResponder/distinfo +++ b/net/mDNSResponder/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.11 2006/03/03 22:30:56 wiz Exp $ +$NetBSD: distinfo,v 1.12 2006/07/11 14:39:29 drochner Exp $ SHA1 (mDNSResponder-108.tar.gz) = d51509077be75ec8ba49c805fef701c3370428fc RMD160 (mDNSResponder-108.tar.gz) = 3a1961f3267bcf009b52c8d8ce234ee6045aeed2 Size (mDNSResponder-108.tar.gz) = 1362840 bytes SHA1 (patch-aa) = 3e8dec4b8d28ed633818edcdea57881dcbb466dc +SHA1 (patch-ab) = 4903e995df9e895bb1cfc49f7fa0c17c8a5379db diff --git a/net/mDNSResponder/patches/patch-ab b/net/mDNSResponder/patches/patch-ab new file mode 100644 index 00000000000..1b87c862023 --- /dev/null +++ b/net/mDNSResponder/patches/patch-ab @@ -0,0 +1,82 @@ +$NetBSD: patch-ab,v 1.5 2006/07/11 14:39:29 drochner Exp $ + +--- mDNSPosix/mDNSPosix.c.orig 2006-02-20 22:40:36.000000000 +0100 ++++ mDNSPosix/mDNSPosix.c +@@ -852,7 +852,13 @@ mDNSlocal int SetupSocket(struct sockadd + { + 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,7 +867,13 @@ mDNSlocal int SetupSocket(struct sockadd + #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)); +@@ -1339,6 +1351,36 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanR + return(err == 0); + } + ++#ifdef __NetBSD__ ++#include <sys/param.h> ++#include <sys/sysctl.h> ++ ++void ++initmachinedescr(mDNS *const m) ++{ ++ char hwbuf[256], swbuf[256]; ++ size_t hwlen, swlen; ++ const int hwmib[] = { CTL_HW, HW_MODEL }; ++ const int swmib[] = { CTL_KERN, KERN_OSRELEASE }; ++ const char netbsd[] = "NetBSD "; ++ ++ hwlen = sizeof(hwbuf); ++ swlen = sizeof(swbuf); ++ if (sysctl(hwmib, 2, hwbuf, &hwlen, 0, 0) || ++ sysctl(swmib, 2, swbuf, &swlen, 0, 0)) ++ return; ++ ++ if (hwlen + swlen + sizeof(netbsd) >=254) ++ return; ++ ++ m->HIHardware.c[0] = hwlen - 1; ++ m->HISoftware.c[0] = swlen + sizeof(netbsd) - 2; ++ memcpy(&m->HIHardware.c[1], hwbuf, hwlen - 1); ++ memcpy(&m->HISoftware.c[1], netbsd, sizeof(netbsd) - 1); ++ memcpy(&m->HISoftware.c[1 + sizeof(netbsd) - 1], swbuf, swlen - 1); ++} ++#endif ++ + // mDNS core calls this routine to initialise the platform-specific data. + mDNSexport mStatus mDNSPlatformInit(mDNS *const m) + { +@@ -1360,6 +1402,10 @@ mDNSexport mStatus mDNSPlatformInit(mDNS + GetUserSpecifiedRFC1034ComputerName(&m->hostlabel); + if (m->hostlabel.c[0] == 0) MakeDomainLabelFromLiteralString(&m->hostlabel, "Computer"); + ++#ifdef __NetBSD__ ++ initmachinedescr(m); ++#endif ++ + mDNS_SetFQDN(m); + + sa.sa_family = AF_INET; |