aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/bind/bin/named/ns_resp.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind/bin/named/ns_resp.c')
-rw-r--r--contrib/bind/bin/named/ns_resp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/bind/bin/named/ns_resp.c b/contrib/bind/bin/named/ns_resp.c
index 0174f9f02034..7bc166ae8c12 100644
--- a/contrib/bind/bin/named/ns_resp.c
+++ b/contrib/bind/bin/named/ns_resp.c
@@ -1,6 +1,6 @@
#if !defined(lint) && !defined(SABER)
static const char sccsid[] = "@(#)ns_resp.c 4.65 (Berkeley) 3/3/91";
-static const char rcsid[] = "$Id: ns_resp.c,v 8.186.6.4 2003/06/02 09:56:35 marka Exp $";
+static const char rcsid[] = "$Id: ns_resp.c,v 8.186.6.5 2003/09/04 03:03:18 marka Exp $";
#endif /* not lint */
/*
@@ -271,7 +271,7 @@ ns_resp(u_char *msg, int msglen, struct sockaddr_in from, struct qstream *qsp)
int soacount;
u_int qtype, qclass;
int validanswer, dbflags;
- int cname, lastwascname, externalcname;
+ int cname, lastwascname, externalcname, cachenegative;
int count, founddata, foundname;
int buflen;
int newmsglen;
@@ -911,6 +911,7 @@ tcp_retry:
cname = 0;
lastwascname = 0;
externalcname = 0;
+ cachenegative = 1;
strcpy(aname, qname);
if (count) {
@@ -980,6 +981,7 @@ tcp_retry:
name);
db_detach(&dp);
validanswer = 0;
+ cachenegative = 0;
continue;
}
if (type == T_CNAME &&
@@ -1014,6 +1016,7 @@ tcp_retry:
"last was cname, ignoring auth. and add.");
db_detach(&dp);
validanswer = 0;
+ cachenegative = 0;
break;
}
if (i < arfirst) {
@@ -1029,6 +1032,7 @@ tcp_retry:
sin_ntoa(from));
db_detach(&dp);
validanswer = 0;
+ cachenegative = 0;
continue;
} else if (!ns_samedomain(name,
qp->q_domain)) {
@@ -1042,6 +1046,7 @@ tcp_retry:
sin_ntoa(from));
db_detach(&dp);
validanswer = 0;
+ cachenegative = 0;
continue;
}
if (type == T_NS) {
@@ -1205,8 +1210,9 @@ tcp_retry:
)
)
{
- cache_n_resp(msg, msglen, from, qp->q_name,
- qp->q_class, qp->q_type);
+ if (cachenegative)
+ cache_n_resp(msg, msglen, from, qp->q_name,
+ qp->q_class, qp->q_type);
if (!qp->q_cmsglen && validanswer) {
ns_debug(ns_log_default, 3,