Current-Users archive

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

Re: ntpq -p coredumps with today's sources



Looks like the current interface addresses do not configure any address of the PF_UNSPEC address family :-(. Following patch makes the fqdn code not bail out when exploring PF_UNSPEC entries.
This should re-enable the name lookup - can you test ?

Frank

On 03/20/12 10:47, Ryo ONODERA wrote:
From: Frank Kardel<kardel%netbsd.org@localhost>, Date: Tue, 20 Mar 2012 
10:13:27 +0100

On 03/20/12 09:59, Martin Husemann wrote:
On Tue, Mar 20, 2012 at 08:39:43AM +0100, Frank Kardel wrote:
Could you check this patch.

ntpq.c exercises the new AI_ADDRCONFIG option in getaddrinfo(). There
seems to
be a PNPE (programmed null pointer exception).
See also PR pkg/46206 (likely the same problem)

Martin
Looks like it from the PR. I can't test right now but the patch should
be very much
the correct fix as the current code is definitely a *0 when
AI_ADDRCONFIG is set.

Can anyone test ?
I have reproduced the problem of firefox.

With your patch, firefox runs (without your patch core dumps).
But firefox cannot resolve hostname.
For example, on firefox, http://www.yahoo.co.jp/ is "Server not found".
http://203.216.227.245/ is displayed properly.

This will help?


Index: getaddrinfo.c
===================================================================
RCS file: /cvsroot/src/lib/libc/net/getaddrinfo.c,v
retrieving revision 1.99
diff -u -r1.99 getaddrinfo.c
--- getaddrinfo.c       20 Mar 2012 10:34:33 -0000      1.99
+++ getaddrinfo.c       20 Mar 2012 10:55:57 -0000
@@ -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