Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Apr 2008 12:08:48 GMT
From:      Ashish Shukla <wahjava@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/123169: dns/nss_mdns: not returning IPv6 address on getaddrinfo() function call
Message-ID:  <200804281208.m3SC8mwK098384@www.freebsd.org>
Resent-Message-ID: <200804281210.m3SCA2ft065354@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         123169
>Category:       ports
>Synopsis:       dns/nss_mdns: not returning IPv6 address on getaddrinfo() function call
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 28 12:10:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Ashish Shukla
>Release:        7.0-RELEASE-p1
>Organization:
N/A
>Environment:
FreeBSD monte-cristo.fr 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #1: Sun Apr 27 23:45:30 IST 2008     root@monte-cristo.fr:/usr/obj/usr/src/sys/ULE  amd64
>Description:
Whenever I execute getaddrinfo() function from libc with a 'hostname.local'
address as an argument and AF_INET6 as ai.ai_family, I always get an IPv4
address, even when 'avahi-resolve-host-name -6 hostname.local' returns
an IPv6 address.
>How-To-Repeat:
I've written a test program getaddrinfo.c[1] which does a
getaddrinfo() function call and prints the result on the terminal.

[1] - http://pastebin.com/pastebin.php?dl=f20d45049
>Fix:
Refer to the attached patch.txt, which is a patch for dns/nss_mdns port, and will fix the issue.

Patch attached with submission follows:

diff -urN /usr/ports/dns/nss_mdns/Makefile nss_mdns/Makefile
--- /usr/ports/dns/nss_mdns/Makefile    2008-01-03 17:53:37.000000000 +0530
+++ nss_mdns/Makefile   2008-04-27 01:22:10.000000000 +0530
@@ -7,7 +7,7 @@

 PORTNAME=      nss_mdns
 PORTVERSION=   0.9
-PORTREVISION=  5
+PORTREVISION=  6
 CATEGORIES=    dns ipv6
 MASTER_SITES=  http://0pointer.de/lennart/projects/nss-mdns/
 DISTNAME=      nss-mdns-${PORTVERSION}
diff -urN /usr/ports/dns/nss_mdns/files/patch-src__bsdnss.c nss_mdns/files/patch-src__bsdnss.c
--- /usr/ports/dns/nss_mdns/files/patch-src__bsdnss.c   2007-04-12 16:13:15.000000000 +0530
+++ nss_mdns/files/patch-src__bsdnss.c  2008-04-27 01:19:18.000000000 +0530
@@ -197,7 +197,7 @@
 +       * 2. Map hostent to addrinfo.
 +       * 3. Hand-off buffer to libc.
 +       */
-+      status = _nss_mdns_gethostbyname_r(name, hp, buffer, mbuflen,
++      status = _nss_mdns_gethostbyname2_r(name, pai->ai_family, hp, buffer, mbuflen,
 +                                         &_errno, &_h_errno);
 +      status = __nss_compat_result(status, _errno);
 +


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804281208.m3SC8mwK098384>