Bug 182718 - net/mDNSResponder crashes on IPV6-capable network
Summary: net/mDNSResponder crashes on IPV6-capable network
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-05 21:50 UTC by Nuno Subtil
Modified: 2013-10-26 18:50 UTC (History)
0 users

See Also:


Attachments
file.diff (494 bytes, patch)
2013-10-05 21:50 UTC, Nuno Subtil
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno Subtil 2013-10-05 21:50:01 UTC
mDNSResponder will crash occasionally when used on a network with IPV6-capable Mac OS X hosts:

Assertion failed: (0), function recvfrom_flags, file mDNSUNP.c, line 665.

This seems to be caused by a wrong/stale set of #defines in mDNSUNP.h

Fix: Patch attached with submission follows:
How-To-Repeat: Run 'mDNSResponderPosix -v 2'
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-05 21:56:36 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Matthieu Volat 2013-10-21 06:49:11 UTC
I confirm the problem and solution.

I also submitted a PR (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/182199) that was wrongly renamed and assigned.

Can this patch be applied, please?

-- 
Matthieu Volat <mazhe@alkumuna.eu>
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-10-26 18:47:34 UTC
Author: sunpoet
Date: Sat Oct 26 17:47:25 2013
New Revision: 331724
URL: http://svnweb.freebsd.org/changeset/ports/331724

Log:
  - Install dns-sd.1 manpage
  - Support STAGEDIR
  - Fix crashes on IPv6 network [1][2][3]
  - Bump PORTREVISION for package change
  
  PR:		ports/182199 [1], ports/182718 [2], ports/182815 [3]
  Submitted by:	Matthieu Volat <mazhe@alkumuna.eu> [1],
  		Nuno Subtil <subtil@gmail.com> [2],
  		Anton Fuller <antonfuller@bv.mintemail.com> [3]

Added:
  head/net/mDNSResponder/pkg-plist   (contents, props changed)
Modified:
  head/net/mDNSResponder/Makefile
  head/net/mDNSResponder/files/patch-mDNSPosix-Makefile

Modified: head/net/mDNSResponder/Makefile
==============================================================================
--- head/net/mDNSResponder/Makefile	Sat Oct 26 17:08:47 2013	(r331723)
+++ head/net/mDNSResponder/Makefile	Sat Oct 26 17:47:25 2013	(r331724)
@@ -3,6 +3,7 @@
 
 PORTNAME=	mDNSResponder
 PORTVERSION=	379.38.1
+PORTREVISION=	1
 CATEGORIES=	net dns
 MASTER_SITES=	http://opensource.apple.com/tarballs/${PORTNAME}/
 
@@ -16,32 +17,29 @@ CONFLICTS=	avahi-libdns-[0-9]*
 
 BUILD_WRKSRC=	${WRKSRC}/mDNSPosix
 INSTALL_WRKSRC=	${WRKSRC}/mDNSPosix
-MAKE_ARGS=	os=freebsd LOCALBASE=${PREFIX} MANPATH=${MANPREFIX}/man
+MAKE_ARGS=	LOCALBASE=${PREFIX} MANPATH=${MANPREFIX}/man os=freebsd
 USES=		bison gmake
 USE_LDCONFIG=	yes
 USE_RC_SUBR=	mdnsd
 
-EXTRA_BIN=	bin/mDNSClientPosix bin/mDNSIdentify bin/mDNSNetMonitor \
-		bin/mDNSProxyResponderPosix bin/mDNSResponderPosix
+EXTRA_BIN=	mDNSClientPosix mDNSIdentify mDNSNetMonitor mDNSProxyResponderPosix mDNSResponderPosix
+EXTRA_MAN1=	dns-sd.1
 EXTRA_MAN8=	dnsextd.8 mDNSResponderPosix.8
-EXTRA_SBIN=	sbin/dnsextd
-MAN8=		mdnsd.8 ${EXTRA_MAN8}
-PLIST_FILES=	bin/dns-sd ${EXTRA_BIN} \
-		include/dns_sd.h \
-		lib/libdns_sd.so lib/libdns_sd.so.1 \
-		sbin/mdnsd ${EXTRA_SBIN}
+EXTRA_SBIN=	dnsextd
 
-NO_STAGE=	yes
 post-patch:
 	@${REINPLACE_CMD} -e '/	cc / s|cc|$${CC}|' ${WRKSRC}/Clients/Makefile
 	@${REINPLACE_CMD} -e 's|-lpthread|-pthread|g; s|mDNSResponder.8|mDNSResponderPosix.8|g' ${WRKSRC}/mDNSPosix/Makefile
+	@${REINPLACE_CMD} -e 's|\(#define IPV6_2292_PKTINFO \).*|\1IPV6_PKTINFO|; s|\(#define IPV6_2292_HOPLIMIT \).*|\1IPV6_HOPLIMIT|' ${WRKSRC}/mDNSPosix/mDNSUNP.h
 	@${MV} ${WRKSRC}/mDNSShared/mDNSResponder.8 ${WRKSRC}/mDNSShared/mDNSResponderPosix.8
 
+post-build:
+	@${STRIP_CMD} ${WRKSRC}/Clients/build/dns-sd ${WRKSRC}/mDNSPosix/build/prod/mdnsd ${WRKSRC}/mDNSPosix/build/prod/libdns_sd.so
+
 post-install:
-	cd ${WRKSRC}/mDNSPosix/build/prod/ && \
-		${INSTALL_PROGRAM} ${EXTRA_BIN:T} ${PREFIX}/bin/ && \
-		${INSTALL_PROGRAM} ${EXTRA_SBIN:T} ${PREFIX}/sbin/
-	cd ${WRKSRC}/mDNSShared/ && \
-		${INSTALL_MAN} ${EXTRA_MAN8} ${MAN8PREFIX}/man/man8/
+	cd ${WRKSRC}/mDNSPosix/build/prod/ && ${INSTALL_PROGRAM} ${EXTRA_BIN} ${STAGEDIR}${PREFIX}/bin/
+	cd ${WRKSRC}/mDNSShared/ && ${INSTALL_MAN} ${EXTRA_MAN1} ${STAGEDIR}${PREFIX}/man/man1/
+	cd ${WRKSRC}/mDNSShared/ && ${INSTALL_MAN} ${EXTRA_MAN8} ${STAGEDIR}${PREFIX}/man/man8/
+	cd ${WRKSRC}/mDNSPosix/build/prod/ && ${INSTALL_PROGRAM} ${EXTRA_SBIN} ${STAGEDIR}${PREFIX}/sbin/
 
 .include <bsd.port.mk>

Modified: head/net/mDNSResponder/files/patch-mDNSPosix-Makefile
==============================================================================
--- head/net/mDNSResponder/files/patch-mDNSPosix-Makefile	Sat Oct 26 17:08:47 2013	(r331723)
+++ head/net/mDNSResponder/files/patch-mDNSPosix-Makefile	Sat Oct 26 17:47:25 2013	(r331724)
@@ -1,5 +1,5 @@
 --- mDNSPosix/Makefile.orig	2011-11-03 08:23:39.000000000 +0800
-+++ mDNSPosix/Makefile	2013-08-16 22:56:35.265791824 +0800
++++ mDNSPosix/Makefile	2013-10-13 02:29:12.791431406 +0800
 @@ -54,7 +54,7 @@
  SHAREDDIR ?= ../mDNSShared
  JDK = /usr/jdk
@@ -40,6 +40,94 @@
  	@$(MAKE) -C ../Clients
  
  # nss_mdns target builds the Name Service Switch module
+@@ -276,43 +276,43 @@
+ #############################################################################
+ 
+ # The Install targets place built stuff in their proper places
+-InstalledDaemon: $(INSTBASE)/sbin/mdnsd
++InstalledDaemon: $(DESTDIR)$(INSTBASE)/sbin/mdnsd
+ 	@echo $+ " installed"
+ 
+-InstalledLib: $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS) $(INSTBASE)/include/dns_sd.h
++InstalledLib: $(DESTDIR)$(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS) $(DESTDIR)$(INSTBASE)/include/dns_sd.h
+ 	@echo $+ " installed"
+ 
+-InstalledStartup: $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
++InstalledStartup: $(DESTDIR)$(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
+ 	@echo $+ " installed"
+ 
+-InstalledManPages: $(MANPATH)/man8/mdnsd.8
++InstalledManPages: $(DESTDIR)$(MANPATH)/man8/mdnsd.8
+ 	@echo $+ " installed"
+ 
+-InstalledClients: $(INSTBASE)/bin/dns-sd
++InstalledClients: $(DESTDIR)$(INSTBASE)/bin/dns-sd
+ 	@echo $+ " installed"
+ 
+-InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8
++InstalledNSS: $(DESTDIR)$(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(DESTDIR)$(MANPATH)/man5/nss_mdns.conf.5 $(DESTDIR)$(MANPATH)/man8/libnss_mdns.8
+ 	@echo $+ " installed"
+ 
+ # Note: If daemon already installed, we make sure it's stopped before overwriting it
+-$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
++$(DESTDIR)$(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
+ 	@if test -x $@; then $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) stop; fi
+ 	$(CP) $< $@
+ 
+-$(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
++$(DESTDIR)$(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
+ 	$(CP) $< $@
+-	$(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
++	$(LN) libdns_sd.$(LDSUFFIX).$(LIBVERS) $(DESTDIR)$(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
+ ifdef LDCONFIG
+     # -m means 'merge into existing database', -R means 'rescan directories'
+ 	$(LDCONFIG) -mR
+ endif
+ 
+-$(INSTBASE)/include/dns_sd.h: $(SHAREDDIR)/dns_sd.h
++$(DESTDIR)$(INSTBASE)/include/dns_sd.h: $(SHAREDDIR)/dns_sd.h
+ 	$(CP) $< $@
+ 
+ # We make this target dependent on $(INSTBASE)/sbin/mdnsd because we need to ensure
+ # that the daemon is installed *before* we try to execute the command to start it.
+-$(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR) $(INSTBASE)/sbin/mdnsd
++$(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR) $(DESTDIR)$(INSTBASE)/sbin/mdnsd
+ 	$(CP) $< $@
+ 	chmod ugo+x $@
+ 	$@ start
+@@ -329,26 +329,26 @@
+ endif
+ endif
+ 
+-$(MANPATH)/man5/%.5: %.5
++$(DESTDIR)$(MANPATH)/man5/%.5: %.5
+ 	cp $< $@
+ 	chmod 444 $@
+ 
+-$(MANPATH)/man8/%.8: %.8
++$(DESTDIR)$(MANPATH)/man8/%.8: %.8
+ 	cp $< $@
+ 	chmod 444 $@
+ 
+-$(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponder.8
++$(DESTDIR)$(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponder.8
+ 	cp $< $@
+ 	chmod 444 $@
+ 
+-$(INSTBASE)/bin/dns-sd: ../Clients/build/dns-sd
++$(DESTDIR)$(INSTBASE)/bin/dns-sd: ../Clients/build/dns-sd
+ 	$(CP) $< $@
+ 
+-$(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE)
++$(DESTDIR)$(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE)
+ 	$(LN) $< $@
+ 	ldconfig
+ 
+-$(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE)
++$(DESTDIR)$(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE)
+ 	$(CP) $< $@
+ 	chmod 444 $@
+ 
 @@ -490,6 +490,8 @@
  $(BUILDDIR)/dnsextd:                 $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o
  	$(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD)

Added: head/net/mDNSResponder/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mDNSResponder/pkg-plist	Sat Oct 26 17:47:25 2013	(r331724)
@@ -0,0 +1,15 @@
+bin/dns-sd
+bin/mDNSClientPosix
+bin/mDNSIdentify
+bin/mDNSNetMonitor
+bin/mDNSProxyResponderPosix
+bin/mDNSResponderPosix
+include/dns_sd.h
+lib/libdns_sd.so
+lib/libdns_sd.so.1
+man/man1/dns-sd.1.gz
+man/man8/dnsextd.8.gz
+man/man8/mDNSResponderPosix.8.gz
+man/man8/mdnsd.8.gz
+sbin/dnsextd
+sbin/mdnsd
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2013-10-26 18:50:44 UTC
State Changed
From-To: open->closed

Committed. Thanks!