|
Lines 280-286
Link Here
|
| 280 |
u_int qtype, qclass; |
280 |
u_int qtype, qclass; |
| 281 |
int restart; /* flag for processing cname response */ |
281 |
int restart; /* flag for processing cname response */ |
| 282 |
int validanswer, dbflags; |
282 |
int validanswer, dbflags; |
| 283 |
int cname, lastwascname, externalcname; |
283 |
int cname, lastwascname, externalcname, cachenegative; |
| 284 |
int count, founddata, foundname; |
284 |
int count, founddata, foundname; |
| 285 |
int buflen; |
285 |
int buflen; |
| 286 |
int newmsglen; |
286 |
int newmsglen; |
|
Lines 905-910
Link Here
|
| 905 |
cname = 0; |
905 |
cname = 0; |
| 906 |
lastwascname = 0; |
906 |
lastwascname = 0; |
| 907 |
externalcname = 0; |
907 |
externalcname = 0; |
|
|
908 |
cachenegative = 1; |
| 908 |
strcpy(aname, qname); |
909 |
strcpy(aname, qname); |
| 909 |
|
910 |
|
| 910 |
if (count) { |
911 |
if (count) { |
|
Lines 974-979
Link Here
|
| 974 |
name); |
975 |
name); |
| 975 |
db_freedata(dp); |
976 |
db_freedata(dp); |
| 976 |
validanswer = 0; |
977 |
validanswer = 0; |
|
|
978 |
cachenegative = 0; |
| 977 |
continue; |
979 |
continue; |
| 978 |
} |
980 |
} |
| 979 |
if (type == T_CNAME && |
981 |
if (type == T_CNAME && |
|
Lines 1004-1009
Link Here
|
| 1004 |
"last was cname, ignoring auth. and add."); |
1006 |
"last was cname, ignoring auth. and add."); |
| 1005 |
db_freedata(dp); |
1007 |
db_freedata(dp); |
| 1006 |
validanswer = 0; |
1008 |
validanswer = 0; |
|
|
1009 |
cachenegative = 0; |
| 1007 |
break; |
1010 |
break; |
| 1008 |
} |
1011 |
} |
| 1009 |
if (i < arfirst) { |
1012 |
if (i < arfirst) { |
|
Lines 1019-1024
Link Here
|
| 1019 |
sin_ntoa(from)); |
1022 |
sin_ntoa(from)); |
| 1020 |
db_freedata(dp); |
1023 |
db_freedata(dp); |
| 1021 |
validanswer = 0; |
1024 |
validanswer = 0; |
|
|
1025 |
cachenegative = 0; |
| 1022 |
continue; |
1026 |
continue; |
| 1023 |
} else if (!ns_samedomain(name, |
1027 |
} else if (!ns_samedomain(name, |
| 1024 |
qp->q_domain)) { |
1028 |
qp->q_domain)) { |
|
Lines 1032-1037
Link Here
|
| 1032 |
sin_ntoa(from)); |
1036 |
sin_ntoa(from)); |
| 1033 |
db_freedata(dp); |
1037 |
db_freedata(dp); |
| 1034 |
validanswer = 0; |
1038 |
validanswer = 0; |
|
|
1039 |
cachenegative = 0; |
| 1035 |
continue; |
1040 |
continue; |
| 1036 |
} |
1041 |
} |
| 1037 |
if (type == T_NS) { |
1042 |
if (type == T_NS) { |
|
Lines 1210-1217
Link Here
|
| 1210 |
) |
1215 |
) |
| 1211 |
) |
1216 |
) |
| 1212 |
{ |
1217 |
{ |
| 1213 |
cache_n_resp(msg, msglen, from, qp->q_name, |
1218 |
if (cachenegative) |
| 1214 |
qp->q_class, qp->q_type); |
1219 |
cache_n_resp(msg, msglen, from, qp->q_name, |
|
|
1220 |
qp->q_class, qp->q_type); |
| 1215 |
|
1221 |
|
| 1216 |
if (!qp->q_cmsglen) { |
1222 |
if (!qp->q_cmsglen) { |
| 1217 |
ns_debug(ns_log_default, 3, |
1223 |
ns_debug(ns_log_default, 3, |