nsd 3.0.2 complains if no -a and no ip-address:

Wouter Wijngaards wouter at NLnetLabs.nl
Wed Nov 29 07:45:04 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Koh-ichi Ito wrote:
> Hello,
> 
> It's on my way of trial on NSD 3.0.2.
> 
> When I invoke nsd without -a option and no 'ip-address:'
> entry on nsd.conf, it complains like
> 
> 	ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3
> 	[1164349528] nsd[69777]: error: cannot parse address '(null)'
> 
> But nsd.conf.5 says...
> 
> 	ip-address: <ip4 or ip6>
> 	....If none are given NSD lis-
> 	tens to all IP addresses. Same as commandline option -a.
> 
> Both giving -a 0.0.0.0 and giving 'ip-address: 0.0.0.0'
> work fine.
> 
> ingram2# /proj/nsd-3.0.2/sbin/nsd -t /proj/nsd3 -a 0.0.0.0
> ingram2# netstat -af inet | grep \\.domain
> tcp4       0      0  *.domain               *.*                    LISTEN
> udp4       0      0  *.domain               *.*
> 
> 
> I observed this case on FreeBSD 6.1.
> 
> ingram2# uname -rs
> FreeBSD 6.1-RELEASE-p10
> 
> 
> I don't understand the behabior of getaddrinfo(NULL, ...),
> {shortage of the background knowledge causes it}, the
> problem may be around there, I guess.
> 
> 
> Any fault on me?

Hi Koh-ichi,

I think you are looking at the wrong error message. It seems that NSD
ignores the error code returned by getaddrinfo. Something else is going
wrong.

getaddrinfo works fine with node=NULL and service="53". This works on my
FreeBSD 6.1 test server. I think you are having some other error. Below
is a change to nsd.c that prints the error in more detail. Could you use
this and see what is really going on?

Thanks for the report - I'll fix the error message to be more
descriptive for upcoming NSD 3.0.3 and 2.3.7.

Best regards,
   Wouter


Index: nsd.c
===================================================================
- --- nsd.c       (revision 2505)
+++ nsd.c       (working copy)
@@ -631,18 +631,26 @@

        /* Set up the address info structures with real interface/port
data */
        for (i = 0; i < nsd.ifs; ++i) {
+               int r;
+
                /* We don't perform name-lookups */
                if (nodes[i] != NULL)
                        hints[i].ai_flags |= AI_NUMERICHOST;

                hints[i].ai_socktype = SOCK_DGRAM;
- -               if (getaddrinfo(nodes[i], udp_port, &hints[i],
&nsd.udp[i].addr) != 0) {
- -                       error("cannot parse address '%s'", nodes[i]);
+               if ((r=getaddrinfo(nodes[i], udp_port, &hints[i],
&nsd.udp[i].addr)) != 0) {
+                       error("cannot parse address '%s': getaddrinfo:
%s %s",
+                               nodes[i]?nodes[i]:"(null)",
+                               gai_strerror(r),
+                               r==EAI_SYSTEM?strerror(errno):"");
                }

                hints[i].ai_socktype = SOCK_STREAM;
- -               if (getaddrinfo(nodes[i], tcp_port, &hints[i],
&nsd.tcp[i].addr) != 0) {
- -                       error("cannot parse address '%s'", nodes[i]);
+               if ((r=getaddrinfo(nodes[i], tcp_port, &hints[i],
&nsd.tcp[i].addr)) != 0) {
+                       error("cannot parse address '%s': getaddrinfo:
%s %s",
+                               nodes[i]?nodes[i]:"(null)",
+                               gai_strerror(r),
+                               r==EAI_SYSTEM?strerror(errno):"");
                }
        }



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFFbTqAkDLqNwOhpPgRAq97AKCfBc0kJwyr8/XRMPWxKCtr4HQUTQCgka2j
AB+JvbN2ss6t9EVLb2WyoL4=
=kWZH
-----END PGP SIGNATURE-----



More information about the nsd-users mailing list