Bug 182199 - dns/mdnsd failing on assertion because badly defined flags
Summary: dns/mdnsd failing on assertion because badly defined flags
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-09-18 08:20 UTC by Matthieu Volat
Modified: 2013-10-26 18:50 UTC (History)
0 users

See Also:


Attachments
file.diff (413 bytes, patch)
2013-09-18 08:20 UTC, Matthieu Volat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Volat 2013-09-18 08:20:00 UTC
When started, the mdnsd service from net/mDNSResponder fails very quickly because failing a catch of "unknown" flags in the recvmsg function.

Turns out that values are strangely hardcoded to wrong values, at least for FreeBSD, in mDNS/mDNSUNP.h.

The following patch fixes the problem :
--- mDNSPosix/mDNSUNP.h.orig      2013-09-18 09:02:04.000000000 +0200
+++ mDNSPosix/mDNSUNP.h 2013-09-18 09:02:55.000000000 +0200
@@ -31,8 +31,8 @@
 // The following are the supported non-linux posix OSes -
 // netbsd, freebsd and openbsd.
 #if HAVE_IPV6
-#define IPV6_2292_PKTINFO  19
-#define IPV6_2292_HOPLIMIT 20
+#define IPV6_2292_PKTINFO  IPV6_PKTINFO
+#define IPV6_2292_HOPLIMIT IPV6_HOPLIMIT
 #endif
 #endif

Fix: Apply the following patch:
How-To-Repeat: * Install net/mDNSResponder
* run mdnsd -debug
* try to do anything that will generate an answer, like dns-sd -G v4v6 somehost.local where the host is sane
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-09-19 03:43:47 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ports-bugs

ports PR.
Comment 2 Edwin Groothuis freebsd_committer 2013-09-19 03:44:17 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Edwin Groothuis freebsd_committer 2013-09-19 03:44:17 UTC
Maintainer of dns/mdnsd,

Please note that PR ports/182199 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/182199

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 4 dan 2013-09-19 10:04:27 UTC
No way to test. I should probably stop being maintainer for this port.
Comment 5 Matthieu Volat 2013-09-19 10:07:13 UTC
Le 19 sept. 2013 à 11:04, Dan Pelleg <dan@pelleg.org> a écrit :

> No way to test. I should probably stop being maintainer for this port.
> 
> 


Sorry Dan, it seems that you were affected this one based on an error : this is about the mdnsd binary in net/mDNSResponder :)

Can it be re-assigned?

-- Mazhe
Comment 6 Matthieu Volat 2013-09-30 20:22:36 UTC
On Thu, 19 Sep 2013 11:07:13 +0200
Matthieu Volat <mazhe@alkumuna.eu> wrote:

> 
> Le 19 sept. 2013 à 11:04, Dan Pelleg <dan@pelleg.org> a écrit :
> 
> > No way to test. I should probably stop being maintainer for this port.
> > 
> > 
> 
> Sorry Dan, it seems that you were affected this one based on an error : this is about the mdnsd binary in net/mDNSResponder :)
> 
> Can it be re-assigned?
> 
> -- Mazhe


Any update for bug re-assignment? If needed, close this one and I will reopen a new one with a clear mention that it concerns net/mDNSResponder, *not* dns/mdnsd.

-- Mazhe
Comment 7 hallo 2013-10-03 13:10:34 UTC
I can confirm that the attached patch fixes the crash for =
mDNSResponder-379.38.1 on 9.2-RELEASE=
Comment 8 Matthieu Volat 2013-10-21 06:50:52 UTC
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/182718 is also reporting the problem. 

While being younger, it is rightly assigned. I propose this bug to be closed.

-- 
Matthieu Volat <mazhe@alkumuna.eu>
Comment 9 dfilter service freebsd_committer 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 10 Po-Chuan Hsieh freebsd_committer 2013-10-26 18:50:00 UTC
State Changed
From-To: feedback->closed

Committed. Thanks! 


Comment 11 Po-Chuan Hsieh freebsd_committer 2013-10-26 18:50:00 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Committed. Thanks!