pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/mDNSResponder



Module Name:    pkgsrc
Committed By:   hauke
Date:           Wed Nov 20 17:56:21 UTC 2024

Modified Files:
        pkgsrc/net/mDNSResponder: Makefile PLIST buildlink3.mk distinfo
        pkgsrc/net/mDNSResponder/patches: patch-mDNSShared_dnssd__clientstub.c
            patch-mDNSShared_uds__daemon.c
Added Files:
        pkgsrc/net/mDNSResponder/files: mdnsd.sh
        pkgsrc/net/mDNSResponder/patches: patch-mDNSPosix_Makefile
            patch-mDNSPosix_mDNSPosix.c patch-mDNSPosix_mDNSUNP.c
            patch-mDNSShared_CommonServices.h
Removed Files:
        pkgsrc/net/mDNSResponder/patches: patch-Clients_dns-sd.c patch-aa
            patch-ab patch-ac patch-ad patch-ae patch-af
            patch-mDNSShared_dnsextd__parser.y

Log Message:
Upgrade net/mDNSResponder to v2559.1.1

Upstream's github repository mainly has patch bombs from Apple's
internal tree, so no changelog.

There is an rc.d script now, and mdnsd will change to a configurable
unprivileged user.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 pkgsrc/net/mDNSResponder/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/net/mDNSResponder/PLIST
cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/mDNSResponder/buildlink3.mk
cvs rdiff -u -r1.39 -r1.40 pkgsrc/net/mDNSResponder/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/net/mDNSResponder/files/mdnsd.sh
cvs rdiff -u -r1.4 -r0 \
    pkgsrc/net/mDNSResponder/patches/patch-Clients_dns-sd.c \
    pkgsrc/net/mDNSResponder/patches/patch-ad
cvs rdiff -u -r1.15 -r0 pkgsrc/net/mDNSResponder/patches/patch-aa
cvs rdiff -u -r1.9 -r0 pkgsrc/net/mDNSResponder/patches/patch-ab
cvs rdiff -u -r1.11 -r0 pkgsrc/net/mDNSResponder/patches/patch-ac
cvs rdiff -u -r1.6 -r0 pkgsrc/net/mDNSResponder/patches/patch-ae
cvs rdiff -u -r1.2 -r0 pkgsrc/net/mDNSResponder/patches/patch-af
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_Makefile \
    pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSPosix.c \
    pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSUNP.c \
    pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_CommonServices.h
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_dnsextd__parser.y
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_dnssd__clientstub.c \
    pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_uds__daemon.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/mDNSResponder/Makefile
diff -u pkgsrc/net/mDNSResponder/Makefile:1.44 pkgsrc/net/mDNSResponder/Makefile:1.45
--- pkgsrc/net/mDNSResponder/Makefile:1.44      Fri Nov 10 11:21:52 2017
+++ pkgsrc/net/mDNSResponder/Makefile   Wed Nov 20 17:56:20 2024
@@ -1,23 +1,37 @@
-# $NetBSD: Makefile,v 1.44 2017/11/10 11:21:52 jperkin Exp $
+# $NetBSD: Makefile,v 1.45 2024/11/20 17:56:20 hauke Exp $
+
+DISTNAME=      ${GITHUB_PROJECT}-${PKGVER}
+GITHUB_PROJECT=        mDNSResponder
+PKGVER=                2559.1.1
+GITHUB_TAG=    refs/tags/${GITHUB_PROJECT}-${PKGVER}
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=apple-oss-distributions/}
 
-DISTNAME=      mDNSResponder-258.14
-PKGREVISION=   3
 CATEGORIES=    net
-MASTER_SITES=  http://www.opensource.apple.com/tarballs/mDNSResponder/
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      https://developer.apple.com/bonjour/
 COMMENT=       Apple's mDNS responder
 LICENSE=       apache-2.0 AND modified-bsd
 
+USE_LANGUAGES= c c++
+
 USE_TOOLS+=            gmake flex bison
+
+WRKSRC=                        ${WRKDIR}/mDNSResponder-mDNSResponder-2559.1.1
 BUILD_DIRS=            mDNSPosix
 BUILDDIR=              ${WRKSRC}/mDNSPosix/build/prod
-AUTO_MKDIRS=           yes
-MAKE_JOBS_SAFE=                no
+
+CFLAGS+=               -Wno-missing-braces
+CFLAGS+=               -DPID_FILE=\"${VARBASE}/run/mdnsd/mdnsd.pid\"
+CFLAGS+=               -DMDNS_UDS_SERVERPATH=\"${VARBASE}/run/mdnsd/mdnsd\"
 
 USE_GCC_RUNTIME=       yes
 
+# File names with spaces
+CHECK_PORTABILITY_SKIP+=       mDNSMacOSX/*
+
+CHECK_RELRO_SKIP+=     lib/libdns_sd.${SO_SUFFIX}
+
 MAKE_ENV.NetBSD+=      os=netbsd
 MAKE_ENV.FreeBSD+=     os=freebsd
 MAKE_ENV.OpenBSD+=     os=openbsd
@@ -31,16 +45,21 @@ SO_SUFFIX.Darwin=   dylib
 SO_SUFFIX.*=           so
 PLIST_SUBST+=          SO_SUFFIX=${SO_SUFFIX:Q}
 
-BINARY=                mDNSClientPosix mDNSIdentify mDNSNetMonitor \
-               mDNSProxyResponderPosix mDNSResponderPosix
-SBINARY=       mdnsd dnsextd
+BINARY=                        mDNSClientPosix mDNSNetMonitor \
+                       mDNSProxyResponderPosix mDNSResponderPosix
+
+SBINARY=               mdnsd
+
+BUILD_DEFS+=           VARBASE
+
+RCD_SCRIPTS=           mdnsd
 
 .include "../../mk/bsd.prefs.mk"
 
 .if !empty(MACHINE_PLATFORM:MSunOS-5.[0-9]-*)
 .include "../../devel/librfuncs/buildlink3.mk"
 
-MAKE_ENV+=     EXTRA_LIBS=-Wl,-R${BUILDLINK_PREFIX.librfuncs}/lib\ ${BUILDLINK_LDFLAGS.librfuncs:Q}
+MAKE_ENV+=     EXTRA_LIBS=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.librfuncs}/lib\ ${BUILDLINK_LDFLAGS.librfuncs:Q}
 .else
 MAKE_ENV+=     EXTRA_LIBS=
 .endif
@@ -53,10 +72,34 @@ PKG_SUGGESTED_OPTIONS=      inet6
 
 .include "../../mk/bsd.options.mk"
 
+MDNS_USER?=            _mdnsd
+MDNS_GROUP?=           _mdnsd
+
+PKG_USERS_VARS+=       MDNS_USER
+PKG_GROUPS_VARS+=      MDNS_GROUP
+PKG_GROUPS=            ${MDNS_GROUP}
+PKG_USERS=             ${MDNS_USER}:${MDNS_GROUP}
+
+PKG_GECOS.${MDNS_USER}=        MDNS web server user
+PKG_HOME.${MDNS_USER}= /nonexistent
+PKG_SHELL.${MDNS_USER}=        ${NOLOGIN}
+
+FILES_SUBST+=          MDNS_USER=${MDNS_USER}
+FILES_SUBST+=          MDNS_GROUP=${MDNS_GROUP}
+
+SUBST_CLASSES+=                user
+SUBST_STAGE.user=      pre-configure
+SUBST_MESSAGE.user=    Fixing unprivileged user name.
+SUBST_FILES.user=      mDNSPosix/PosixDaemon.c
+SUBST_SED.user=                -e 's,nobody,${MDNS_USER},g'
+
 .if !empty(PKG_OPTIONS:Minet6)
 MAKE_ENV+=     HAVE_IPV6=1
 .endif
 
+INSTALLATION_DIRS=     bin sbin lib include
+INSTALLATION_DIRS+=    ${PKGMANDIR}/man1 ${PKGMANDIR}/man8
+
 do-install:
        for i in ${BINARY}; do \
                ${INSTALL_PROGRAM} ${BUILDDIR}/$$i ${DESTDIR}${PREFIX}/bin; \
@@ -66,7 +109,6 @@ do-install:
        done
        ${INSTALL_PROGRAM} ${WRKSRC}/Clients/build/dns-sd ${DESTDIR}${PREFIX}/bin
        ${INSTALL_MAN} ${WRKSRC}/mDNSShared/dns-sd.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
-       ${INSTALL_MAN} ${WRKSRC}/mDNSShared/dnsextd.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
        ${INSTALL_MAN} ${WRKSRC}/mDNSShared/mDNSResponder.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/mdnsd.8
        ${INSTALL_DATA} ${WRKSRC}/mDNSShared/dns_sd.h ${DESTDIR}${PREFIX}/include
        ${INSTALL_LIB} ${BUILDDIR}/libdns_sd.${SO_SUFFIX} ${DESTDIR}${PREFIX}/lib

Index: pkgsrc/net/mDNSResponder/PLIST
diff -u pkgsrc/net/mDNSResponder/PLIST:1.4 pkgsrc/net/mDNSResponder/PLIST:1.5
--- pkgsrc/net/mDNSResponder/PLIST:1.4  Wed Jul 14 09:29:04 2010
+++ pkgsrc/net/mDNSResponder/PLIST      Wed Nov 20 17:56:20 2024
@@ -1,14 +1,11 @@
-@comment $NetBSD: PLIST,v 1.4 2010/07/14 09:29:04 sbd Exp $
+@comment $NetBSD: PLIST,v 1.5 2024/11/20 17:56:20 hauke Exp $
 bin/dns-sd
 bin/mDNSClientPosix
-bin/mDNSIdentify
 bin/mDNSNetMonitor
 bin/mDNSProxyResponderPosix
 bin/mDNSResponderPosix
 include/dns_sd.h
 lib/libdns_sd.${SO_SUFFIX}
 man/man1/dns-sd.1
-man/man8/dnsextd.8
 man/man8/mdnsd.8
-sbin/dnsextd
 sbin/mdnsd

Index: pkgsrc/net/mDNSResponder/buildlink3.mk
diff -u pkgsrc/net/mDNSResponder/buildlink3.mk:1.9 pkgsrc/net/mDNSResponder/buildlink3.mk:1.10
--- pkgsrc/net/mDNSResponder/buildlink3.mk:1.9  Mon May  7 01:53:53 2012
+++ pkgsrc/net/mDNSResponder/buildlink3.mk      Wed Nov 20 17:56:20 2024
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.9 2012/05/07 01:53:53 dholland Exp $
+# $NetBSD: buildlink3.mk,v 1.10 2024/11/20 17:56:20 hauke Exp $
 
 BUILDLINK_TREE+=       mDNSResponder
 
@@ -6,7 +6,7 @@ BUILDLINK_TREE+=        mDNSResponder
 MDNSRESPONDER_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.mDNSResponder+=  mDNSResponder>=98
-BUILDLINK_ABI_DEPENDS.mDNSResponder+=  mDNSResponder>=214.3.2
+BUILDLINK_ABI_DEPENDS.mDNSResponder+=  mDNSResponder>=2559.1.1
 BUILDLINK_PKGSRCDIR.mDNSResponder?=    ../../net/mDNSResponder
 .endif # MDNSRESPONDER_BUILDLINK3_MK
 

Index: pkgsrc/net/mDNSResponder/distinfo
diff -u pkgsrc/net/mDNSResponder/distinfo:1.39 pkgsrc/net/mDNSResponder/distinfo:1.40
--- pkgsrc/net/mDNSResponder/distinfo:1.39      Tue Oct 26 11:05:58 2021
+++ pkgsrc/net/mDNSResponder/distinfo   Wed Nov 20 17:56:20 2024
@@ -1,15 +1,11 @@
-$NetBSD: distinfo,v 1.39 2021/10/26 11:05:58 nia Exp $
+$NetBSD: distinfo,v 1.40 2024/11/20 17:56:20 hauke Exp $
 
-BLAKE2s (mDNSResponder-258.14.tar.gz) = 49856d3a34bf3bb978c1c2a4925a02ce6043b6b766d1b3f75d931ca92bdbdef3
-SHA512 (mDNSResponder-258.14.tar.gz) = 910962e965ae7d82203fda8a962f63ea59d5d28fb514d051364759c6c8b37402a6f0e4f8dafd922077ef25a5d0cc4f5ced8166913ca21cd9deca9c465dd7ea33
-Size (mDNSResponder-258.14.tar.gz) = 1833244 bytes
-SHA1 (patch-Clients_dns-sd.c) = 5adac63ba76497056c1abfd426460560b8a3f012
-SHA1 (patch-aa) = 39aa4cec05844864ec6f8987a1026ecd050a9db6
-SHA1 (patch-ab) = 473db16e4d454899c364fb2d9fa8d344d47ca008
-SHA1 (patch-ac) = 9907f0e55d421fccd3d491d4f0d872f328198c19
-SHA1 (patch-ad) = 2492a26a500ebef3902cbd19f0ab7bc9005588a1
-SHA1 (patch-ae) = 49091d627fd3a800ed027566c728022b901d126b
-SHA1 (patch-af) = c0787da4901a9dd4ff02063e11bcd9daf2a5c6b4
-SHA1 (patch-mDNSShared_dnsextd__parser.y) = dde7eca76c2b5158c2ac96764f91ce773464094a
-SHA1 (patch-mDNSShared_dnssd__clientstub.c) = 591801ae08dce4a44c06dd52a46fcd63807eafcc
-SHA1 (patch-mDNSShared_uds__daemon.c) = df279d3871bb6ead1563c79c99c4d2dc6d91ff79
+BLAKE2s (mDNSResponder-2559.1.1.tar.gz) = e72fbea9df78d0cf811e1af6d08483973487210594e165b7b075f0b32f595d97
+SHA512 (mDNSResponder-2559.1.1.tar.gz) = 1112d78e3a46115ffdae4849d847a6cfe1052d6e4a6af3afa6058eb900ac7f7c8fee20874b479ff3d40af2da95a371241f2c821a193f148f844bf9efc06fcc79
+Size (mDNSResponder-2559.1.1.tar.gz) = 3362635 bytes
+SHA1 (patch-mDNSPosix_Makefile) = 3e91025e5e878d0f2552d3f82839db31c67b31d7
+SHA1 (patch-mDNSPosix_mDNSPosix.c) = bfefa8d1252d0ba9afdf6506dd6686492dd1f10b
+SHA1 (patch-mDNSPosix_mDNSUNP.c) = a900ad9991aaee21fbe9094a65900b1d172c2abc
+SHA1 (patch-mDNSShared_CommonServices.h) = b67ab3e9821cb30406ff5cfb1a394c5b18bb0009
+SHA1 (patch-mDNSShared_dnssd__clientstub.c) = 1c9a7d39101feebdac80f4982f1003da343c60e7
+SHA1 (patch-mDNSShared_uds__daemon.c) = c647c27f82cc80a5576d1c934d978260489311e7

Index: pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_dnssd__clientstub.c
diff -u pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_dnssd__clientstub.c:1.1 pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_dnssd__clientstub.c:1.2
--- pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_dnssd__clientstub.c:1.1   Mon May 12 15:06:56 2014
+++ pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_dnssd__clientstub.c       Wed Nov 20 17:56:21 2024
@@ -1,14 +1,39 @@
-$NetBSD: patch-mDNSShared_dnssd__clientstub.c,v 1.1 2014/05/12 15:06:56 ryoon Exp $
+$NetBSD: patch-mDNSShared_dnssd__clientstub.c,v 1.2 2024/11/20 17:56:21 hauke Exp $
 
-Required for OpenBSD 5.5
+Quality Code Pasto
 
---- mDNSShared/dnssd_clientstub.c.orig 2010-06-17 00:06:28.000000000 +0000
+--- mDNSShared/dnssd_clientstub.c.orig 2024-11-19 18:13:39.474891771 +0000
 +++ mDNSShared/dnssd_clientstub.c
-@@ -74,6 +74,7 @@
-       #include <sys/fcntl.h>          // For O_RDWR etc.
-       #include <sys/time.h>
-       #include <sys/socket.h>
-+      #include <sys/uio.h>
-       #include <syslog.h>
-       
-       #define sockaddr_mdns sockaddr_un
+@@ -2023,6 +2023,8 @@ DNSServiceErrorType DNSServiceRegisterIn
+     DNSServiceErrorType err;
+     union { uint16_t s; u_char b[2]; } port = { portInNetworkByteOrder };
+     (void)attr;
++    const uint8_t *limit;
++
+ 
+     if (!sdRef || !regtype) return kDNSServiceErr_BadParam;
+     if (!name) name = "";
+@@ -2054,6 +2056,7 @@ DNSServiceErrorType DNSServiceRegisterIn
+     if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; }
+     if (!callBack) hdr->ipc_flags |= IPC_FLAGS_NOREPLY;
+ 
++    limit = ptr + len;
+     put_flags(flags, &ptr);
+     put_uint32(interfaceIndex, &ptr);
+     put_string(name, &ptr);
+@@ -2335,6 +2338,7 @@ DNSServiceErrorType DNSServiceRegisterRe
+     DNSRecordRef rref = NULL;
+     DNSRecord **p;
+     (void)attr;
++    const uint8_t *limit;
+ 
+     // Verify that only one of the following flags is set.
+     int f1 = (flags & kDNSServiceFlagsShared) != 0;
+@@ -2389,6 +2393,7 @@ DNSServiceErrorType DNSServiceRegisterRe
+     hdr = create_hdr(reg_record_request, &len, &ptr, !(flags & kDNSServiceFlagsQueueRequest), sdRef);
+     if (!hdr) return kDNSServiceErr_NoMemory;
+ 
++    limit = ptr + len;
+     put_flags(flags, &ptr);
+     put_uint32(interfaceIndex, &ptr);
+     put_string(fullname, &ptr);
Index: pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_uds__daemon.c
diff -u pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_uds__daemon.c:1.1 pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_uds__daemon.c:1.2
--- pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_uds__daemon.c:1.1 Mon May 12 15:06:56 2014
+++ pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_uds__daemon.c     Wed Nov 20 17:56:21 2024
@@ -1,10 +1,12 @@
-$NetBSD: patch-mDNSShared_uds__daemon.c,v 1.1 2014/05/12 15:06:56 ryoon Exp $
+$NetBSD: patch-mDNSShared_uds__daemon.c,v 1.2 2024/11/20 17:56:21 hauke Exp $
 
-Required for OpenBSD 5.5
+Include required for OpenBSD 5.5
 
---- mDNSShared/uds_daemon.c.orig       2010-08-24 00:28:17.000000000 +0000
+MAX() defined, but not in scope, so do it here
+
+--- mDNSShared/uds_daemon.c.orig       2024-09-24 20:38:46.000000000 +0000
 +++ mDNSShared/uds_daemon.c
-@@ -25,6 +25,7 @@
+@@ -24,6 +24,7 @@
  #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/resource.h>
@@ -12,3 +14,15 @@ Required for OpenBSD 5.5
  #endif
  
  #include <stdlib.h>
+@@ -158,6 +159,11 @@ mDNSexport DNameListElem *AutoBrowseDoma
+ #endif
+ #endif
+ 
++/* From dns_common.h */
++#ifndef MAX
++#define MAX(A, B) (((A) > (B)) ? (A) : (B))
++#endif
++
+ //======================================================================================================================
+ // MARK: - Log macro for request state logging.
+ 

Added files:

Index: pkgsrc/net/mDNSResponder/files/mdnsd.sh
diff -u /dev/null pkgsrc/net/mDNSResponder/files/mdnsd.sh:1.1
--- /dev/null   Wed Nov 20 17:56:21 2024
+++ pkgsrc/net/mDNSResponder/files/mdnsd.sh     Wed Nov 20 17:56:20 2024
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $NetBSD: mdnsd.sh,v 1.1 2024/11/20 17:56:20 hauke Exp $
+#
+
+# PROVIDE: mdnsd
+# REQUIRE: network mountcritlocal staticroute
+# BEFORE:  NETWORKING
+
+if [ -f /etc/rc.subr ]
+then
+    $_rc_subr_loaded . /etc/rc.subr
+fi
+
+name="mdnsd"
+rcvar=$name
+command="@PREFIX@/sbin/$name"
+pidfile="@VARBASE@/run/mdnsd/${name}.pid"
+start_precmd="mdnsd_precmd"
+
+mdnsd_precmd()
+{
+    if [ ! -d @VARBASE@/run/mdnsd ]; then
+        mkdir -p -m 755 @VARBASE@/run/mdnsd
+    fi
+    chown @MDNS_USER@:@MDNS_GROUP@ @VARBASE@/run/mdnsd
+}
+                                                        
+load_rc_config $name
+run_rc_command "$1"

Index: pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_Makefile
diff -u /dev/null pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_Makefile:1.1
--- /dev/null   Wed Nov 20 17:56:21 2024
+++ pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_Makefile   Wed Nov 20 17:56:21 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-mDNSPosix_Makefile,v 1.1 2024/11/20 17:56:21 hauke Exp $
+
+Set PID_FILE and MDNS_UDS_SERVERPATH in the package Makefile
+
+--- mDNSPosix/Makefile.orig    2024-11-20 16:54:24.312698073 +0000
++++ mDNSPosix/Makefile
+@@ -62,7 +62,7 @@ SOOPTS = -shared
+ CP = cp
+ RM = rm
+ LN = ln -s -f
+-CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(UTILDIR) -I$(DSODIR) -I$(SERVICEREGISTRATIONDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPOSIX_BUILD -DPID_FILE=\"/var/run/mdnsd.pid\" 
-DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
++CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(UTILDIR) -I$(DSODIR) -I$(SERVICEREGISTRATIONDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPOSIX_BUILD
+ CFLAGS_PTHREAD =
+ LINKOPTS =
+ LINKOPTS_PTHREAD = -lpthread
Index: pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSPosix.c
diff -u /dev/null pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSPosix.c:1.1
--- /dev/null   Wed Nov 20 17:56:21 2024
+++ pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSPosix.c        Wed Nov 20 17:56:21 2024
@@ -0,0 +1,67 @@
+$NetBSD: patch-mDNSPosix_mDNSPosix.c,v 1.1 2024/11/20 17:56:21 hauke Exp $
+
+ - OpenBSD fix from
+https://web.archive.org/web/20140115063128/http://lists.apple.com/archives/bonjour-dev/2007/Jan/msg00003.html
+
+ - NetBSD HINFO record from hw.model and kern.osrelease
+
+--- mDNSPosix/mDNSPosix.c.orig 2024-11-20 15:54:56.086626755 +0000
++++ mDNSPosix/mDNSPosix.c
+@@ -453,7 +453,7 @@ mDNSlocal void SocketDataReady(mDNS *con
+         // so all we can do is just assume it's a multicast
+ 
+         #if HAVE_BROKEN_RECVDSTADDR || (!defined(IP_PKTINFO) && !defined(IP_RECVDSTADDR))
+-        if ((destAddr.NotAnInteger == 0) && (flags & MSG_MCAST))
++        if ((destAddr.ip.v4.NotAnInteger == 0) && (flags & MSG_MCAST))
+         {
+             destAddr.type = senderAddr.type;
+             if      (senderAddr.type == mDNSAddrType_IPv4) destAddr.ip.v4 = AllDNSLinkGroup_v4.ip.v4;
+@@ -1849,6 +1855,37 @@ 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)
+ {
+@@ -1870,6 +1907,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;
Index: pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSUNP.c
diff -u /dev/null pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSUNP.c:1.1
--- /dev/null   Wed Nov 20 17:56:21 2024
+++ pkgsrc/net/mDNSResponder/patches/patch-mDNSPosix_mDNSUNP.c  Wed Nov 20 17:56:21 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-mDNSPosix_mDNSUNP.c,v 1.1 2024/11/20 17:56:21 hauke Exp $
+
+* For OpenBSD, from
+  http://lists.apple.com/archives/bonjour-dev/2007/Jan/msg00003.html
+
+--- mDNSPosix/mDNSUNP.c.orig   2024-11-20 16:16:30.408955628 +0000
++++ mDNSPosix/mDNSUNP.c
+@@ -87,6 +87,14 @@ recvfrom_flags(int fd, void *ptr, size_t
+            set the value to 0, but I'm concerned that 0
+            might be a valid interface value.
+          */
++#if HAVE_BROKEN_RECVDSTADDR
++        /* similar to the issue with OpenBSD in mDNSPosix.c, we need
++           to preset sin_family to IF_NET, because of broken IP_RECVDSTADDR
++         */
++        struct in_pktinfo *tmp;
++        struct sockaddr_in *sin = (struct sockaddr_in*)&pktp->ipi_addr;
++        sin->sin_family = AF_INET;
++#endif
+         memset(pktp, 0, sizeof(struct my_in_pktinfo));
+         pktp->ipi_ifindex = -1;
+     }
Index: pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_CommonServices.h
diff -u /dev/null pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_CommonServices.h:1.1
--- /dev/null   Wed Nov 20 17:56:21 2024
+++ pkgsrc/net/mDNSResponder/patches/patch-mDNSShared_CommonServices.h  Wed Nov 20 17:56:21 2024
@@ -0,0 +1,121 @@
+$NetBSD: patch-mDNSShared_CommonServices.h,v 1.1 2024/11/20 17:56:21 hauke Exp $
+
+Cater to various *BSDs
+
+--- mDNSShared/CommonServices.h.orig   2024-09-24 20:38:46.000000000 +0000
++++ mDNSShared/CommonServices.h
+@@ -54,6 +54,16 @@ extern "C" {
+     #endif
+ #endif
+ 
++// NetBSD
++
++#if ( !defined( TARGET_OS_NETBSD ) )
++    #if ( defined( __NetBSD__ ) )
++        #define TARGET_OS_NETBSD       1
++    #else
++        #define TARGET_OS_NETBSD       0
++    #endif
++#endif
++
+ // FreeBSD
+ 
+ #if ( !defined( TARGET_OS_FREEBSD ) )
+@@ -64,6 +74,16 @@ extern "C" {
+     #endif
+ #endif
+ 
++// DragonFly
++
++#if ( !defined( TARGET_OS_DRAGONFLY ) )
++    #if ( defined( __DragonFly__ ) )
++        #define TARGET_OS_DRAGONFLY       1
++    #else
++        #define TARGET_OS_DRAGONFLY       0
++    #endif
++#endif
++
+ // Linux
+ 
+ #if ( !defined( TARGET_OS_LINUX ) )
+@@ -84,6 +104,16 @@ extern "C" {
+     #endif
+ #endif
+ 
++// OpenBSD
++
++#if ( !defined( TARGET_OS_OPENBSD ) )
++    #if ( defined( __OpenBSD__ ) )
++        #define TARGET_OS_OPENBSD       1
++    #else
++        #define TARGET_OS_OPENBSD       0
++    #endif
++#endif
++
+ // Palm
+ 
+ #if ( !defined( TARGET_OS_PALM ) )
+@@ -177,6 +207,22 @@ extern "C" {
+     #include    <libkern/OSTypes.h>
+     #include    <sys/types.h>
+ 
++#elif ( TARGET_OS_NETBSD )
++
++// NetBSD
++    #include    <stdint.h>
++    #include    <pthread.h>
++    #include    <netinet/in.h>
++    #include    <arpa/inet.h>
++    #include    <sys/socket.h>
++
++    #if ( defined( BYTE_ORDER ) && defined( LITTLE_ENDIAN ) && ( BYTE_ORDER == LITTLE_ENDIAN ) )
++        #define TARGET_RT_LITTLE_ENDIAN     1
++    #endif
++    #if ( defined( BYTE_ORDER ) && defined( BIG_ENDIAN ) && ( BYTE_ORDER == BIG_ENDIAN ) )
++        #define TARGET_RT_BIG_ENDIAN        1
++    #endif
++
+ #elif ( TARGET_OS_FREEBSD )
+ 
+ // FreeBSD
+@@ -186,6 +232,15 @@ extern "C" {
+     #include    <arpa/inet.h>
+     #include    <sys/socket.h>
+ 
++#elif ( TARGET_OS_DRAGONFLY )
++
++// DragonFly BSD
++    #include    <stdint.h>
++    #include    <pthread.h>
++    #include    <netinet/in.h>
++    #include    <arpa/inet.h>
++    #include    <sys/socket.h>
++
+ #elif ( TARGET_OS_LINUX )
+ 
+ // Linux
+@@ -209,6 +264,15 @@ extern "C" {
+         #define TARGET_RT_BIG_ENDIAN        1
+     #endif
+ 
++#elif ( TARGET_OS_OPENBSD )
++
++// OpenBSD
++    #include    <stdint.h>
++    #include    <pthread.h>
++    #include    <netinet/in.h>
++    #include    <arpa/inet.h>
++    #include    <sys/socket.h>
++
+ #elif ( TARGET_OS_PALM )
+ 
+ // Palm (no special includes yet).
+@@ -447,7 +511,7 @@ typedef int socklen_t;
+ // - Mac OS X when not building with BSD headers
+ // - Windows
+ 
+-#if ( !defined(_SSIZE_T) && ( TARGET_OS_WIN32 || !defined( _BSD_SSIZE_T_DEFINED_ ) ) && !TARGET_OS_FREEBSD && !TARGET_OS_LINUX && !TARGET_OS_MAC)
++#if ( !defined(_SSIZE_T) && ( TARGET_OS_WIN32 || !defined( _BSD_SSIZE_T_DEFINED_ ) ) && !TARGET_OS_NETBSD && !TARGET_OS_FREEBSD && !TARGET_OS_DRAGONFLY && !TARGET_OS_LINUX && !TARGET_OS_OPENBSD && 
!TARGET_OS_MAC)
+ typedef int ssize_t;
+ #endif
+ 



Home | Main Index | Thread Index | Old Index