behavior of k.root-servers.net

Erik Rozendaal erik at NLnetLabs.nl
Thu Jul 17 12:16:39 CEST 2003


Yasuhiro Orange Morishita wrote:
> Erik-san;
> 
> Thank you for your quick action.
> 
> To: administrators of k.root-servers.net;
> Please apply this patch to NSD on K.root-servers.net.

Actually, k.root-servers.net is running NSD 1.0.2:

$ dig @k.root-servers.net version.server chaos txt

; <<>> DiG 9.2.1 <<>> @k.root-servers.net version.server chaos txt
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39488
;; flags: qr; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;version.server.                        CH      TXT

;; ANSWER SECTION:
version.server.         0       CH      TXT     "NSD-1.0.2"

;; Query time: 37 msec
;; SERVER: 193.0.14.129#53(k.root-servers.net)
;; WHEN: Thu Jul 17 11:04:37 2003
;; MSG SIZE  rcvd: 54

The previous patch won't apply, use the attached patch for 1.0.2.

Erik
-------------- next part --------------
? nsd
? nsd-notify
? nsdc.conf.sample
? nsdc.sh
? zonec
Index: Makefile
===================================================================
RCS file: /cvs/nsd/Attic/Makefile,v
retrieving revision 1.84.2.3
diff -u -r1.84.2.3 Makefile
--- Makefile	2 Jan 2003 10:43:14 -0000	1.84.2.3
+++ Makefile	17 Jul 2003 09:15:08 -0000
@@ -67,7 +67,7 @@
 #
 
 # The directory where the nsd nsdc and zonec binaries will be installed
-PREFIX		= /usr/local
+PREFIX		= /home/erik/opt/nsd
 NSDBINDIR	= ${PREFIX}/sbin
 NSDMANDIR	= ${PREFIX}/man/man8
 
@@ -78,7 +78,7 @@
 NSDZONES	= ${NSDZONESDIR}/nsd.zones
 
 # The pid file of the nsd
-NSDPIDFILE      = /var/run/nsd.pid
+NSDPIDFILE      = ${PREFIX}/var/run/nsd.pid
 
 # The NSD run-time database
 NSDDB           = ${NSDZONESDIR}/nsd.db
@@ -142,7 +142,7 @@
 #
 #	Please see DBFLAGS below to switch the internal database type.
 #
-FEATURES	= -DLOG_NOTIFIES -DINET6 -DHOSTS_ACCESS -DBIND8_STATS
+FEATURES	= -DLOG_NOTIFIES -DHOSTS_ACCESS -DBIND8_STATS
 LIBWRAP		= -lwrap
 
 # To compile NSD with internal red-black tree database
Index: query.c
===================================================================
RCS file: /cvs/nsd/query.c,v
retrieving revision 1.83
diff -u -r1.83 query.c
--- query.c	14 Oct 2002 13:12:16 -0000	1.83
+++ query.c	17 Jul 2003 09:15:08 -0000
@@ -397,9 +397,10 @@
 	qname = qptr = q->iobuf + QHEADERSZ;
 	while(*qptr) {
 		/*  If we are out of buffer limits or we have a pointer in question dname or the domain name is longer than MAXDOMAINLEN ... */
-		if((qptr + *qptr > q->iobufptr) || (*qptr & 0xc0) ||
-			((qptr - q->iobuf + *qptr) > MAXDOMAINLEN)) {
-
+		if ((*qptr & 0xc0) ||
+		    (qptr + *qptr + 1 > q->iobufptr) || 
+		    (qptr + *qptr + 1 > q->iobuf + QHEADERSZ + MAXDOMAINLEN))
+		{
 			query_formerr(q);
 			return 0;
 		}


More information about the nsd-users mailing list