named 8.2.2-p5 crash

Jeroen Ruigrok van der Werven asmodai at bart.nl
Mon Mar 20 20:53:30 UTC 2000


-On [20000320 14:45], Mark.Andrews at nominum.com (Mark.Andrews at nominum.com) wrote:
>
>	There is not much to it, but I don't have it as a seperate
>	patch.  It's intergated with other changes though it would not
>	be that hard to pull the changes out if you wanted to do that.
>	See ns_stopnotify().

Mark,

would this be all that it would take [see attached patch]?

Will dig around the sources some more tomorrow.  Diff is relative to the
FreeBSD named location.

-- 
Jeroen Ruigrok van der Werven          Network- and systemadministrator
<asmodai at bart.nl>                      VIA NET.WORKS The Netherlands
BSD: Technical excellence at its best  http://www.bart.nl
To desire immortality is to desire the eternal perpetuation of a great
mistake...


-- Attached file included as plaintext by Listar --

--- src/contrib/bind/bin/named/ns_notify.c.orig	Mon Mar 20 16:12:11 2000
+++ src/contrib/bind/bin/named/ns_notify.c	Mon Mar 20 21:38:26 2000
@@ -1,5 +1,5 @@
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: ns_notify.c,v 8.4 1999/10/15 19:49:04 vixie Exp $";
+static const char rcsid[] = "$Id: ns_notify.c,v 8.7 2000/02/04 08:04:13 vixie Exp $";
 #endif /* not lint */
 
 /*
@@ -78,6 +78,7 @@
 /* Local. */
 
 static LIST(struct notify) pending_notifies;
+static LIST(struct notify) loading_notifies;
 
 /* Public. */
 
@@ -100,6 +101,12 @@
 			   p_class(class), p_type(type));
 		return;
 	}
+	if (ns_samename(dname, zp->z_origin) != 1) {
+		ns_warning(ns_log_notify,
+			   "notify not called with top of zone (\"%s\" %s %s)",
+			   (dname && *dname) ? dname : ".",
+			   p_class(class), p_type(type));
+	}
 	if ((zp->z_flags & Z_NOTIFY) != 0) {
 		ns_info(ns_log_notify,
 			"suppressing duplicate notify (\"%s\" %s %s)",
@@ -123,6 +130,11 @@
 	ni->type = type;
 	evInitID(&ni->timer);
 
+	if (loading != 0) {
+		APPEND(loading_notifies, ni, link);
+		return;
+	}
+
 	/* Delay notification for from five seconds up to fifteen minutes. */
 	max_delay = MIN(nzones/5, 895);
 	max_delay = MAX(max_delay, 25);
@@ -146,6 +158,19 @@
 		 ni, zp, delay);
 }
 
+void
+notify_afterload() {
+	struct notify *ni;
+
+	INSIST(loading == 0);
+	while ((ni = HEAD(loading_notifies)) != NULL) {
+		UNLINK(loading_notifies, ni, link);
+		ns_notify(ni->name, ni->class, ni->type);
+		freestr(ni->name);
+		memput(ni, sizeof *ni);
+	}
+}
+
 /*
  * ns_unnotify()
  *	call this when all pending notifies are now considered junque.
@@ -161,6 +186,25 @@
 	}
 }
 
+/*
+ * ns_stopnotify(const char *dname, ns_class class)
+ *     stop notifies for this particular zone.
+ */
+void
+ns_stopnotify(const char *dname, ns_class class) {
+	struct notify *ni;
+
+	ni = HEAD(pending_notifies);
+	while (ni != NULL &&
+	       (ni->class != class || ns_samename(ni->name, dname) != 1))
+		ni = NEXT(ni, link);
+
+	if (ni != NULL) {
+		UNLINK(pending_notifies, ni, link);
+		free_notify(ni);
+	}
+}
+
 /* Private. */
 
 /*
@@ -199,9 +243,7 @@
 	}
 	zname = zp->z_origin;
 	nns = na = 0;
-	if (zp->z_type == z_master)
-		sysnotify_slaves(dname, zname, class, type,
-				 zp - zones, &nns, &na);
+	sysnotify_slaves(dname, zname, class, type, zp - zones, &nns, &na);
 
 	/*
 	 * Handle any global or zone-specific also-notify clauses
@@ -349,7 +391,7 @@
 
 	INSIST(!LINKED(ni, link));
 	zp = find_auth_zone(ni->name, ni->class);
-	if (zp != NULL) {
+	if (zp != NULL && ns_samename(ni->name, zp->z_origin) == 1) {
 		INSIST((zp->z_flags & Z_NOTIFY) != 0);
 		zp->z_flags &= ~Z_NOTIFY;
 	}




More information about the bind-users mailing list