Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/net PR pkg/46206



details:   https://anonhg.NetBSD.org/src/rev/9613993584e8
branches:  trunk
changeset: 778233:9613993584e8
user:      kardel <kardel%NetBSD.org@localhost>
date:      Tue Mar 20 12:04:01 2012 +0000

description:
PR pkg/46206
re-establish fqdn lookup when AI_ADDRCONFIG is used in hints
AI_ADDRCONFIG led to fqdn lookup being skipped as the systems didn't
configure any PF_UNSPEC addresses - check was too strict here.
Thnaks to Ryo ONODERA for testing.

diffstat:

 lib/libc/net/getaddrinfo.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r a8ed7d18f67e -r 9613993584e8 lib/libc/net/getaddrinfo.c
--- a/lib/libc/net/getaddrinfo.c        Tue Mar 20 11:28:04 2012 +0000
+++ b/lib/libc/net/getaddrinfo.c        Tue Mar 20 12:04:01 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getaddrinfo.c,v 1.99 2012/03/20 10:34:33 kardel Exp $  */
+/*     $NetBSD: getaddrinfo.c,v 1.100 2012/03/20 12:04:01 kardel Exp $ */
 /*     $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $    */
 
 /*
@@ -55,7 +55,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.99 2012/03/20 10:34:33 kardel Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.100 2012/03/20 12:04:01 kardel Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -503,8 +503,11 @@
        for (ex = explore; ex->e_af >= 0; ex++) {
                *pai = ai0;
 
+
                /* ADDRCONFIG check */
-               if ((((uint64_t)1 << ex->e_af) & mask) == 0)
+               /* PF_UNSPEC entries are prepared for DNS queries only */
+               if (ex->e_af != PF_UNSPEC &&
+                   (((uint64_t)1 << ex->e_af) & mask) == 0)
                        continue;
 
                /* require exact match for family field */



Home | Main Index | Thread Index | Old Index