Commit Diff
Diff:
dbaa9c14090fe4bb617b8f490a0de5310ce71e8b
cfbdfdca30a7892eab2b34b22211601859332a53
Commit:
cfbdfdca30a7892eab2b34b22211601859332a53
Tree:
d09bca3cafbf6b8e520df3195cbc29b4d23d7de7
Author:
pbug <pbug@delphinusdns.org>
Committer:
pbug <pbug@delphinusdns.org>
Date:
Fri Sep 24 08:12:14 2010 UTC
Message:
* back out partially last commit, the recursion stopped with it * make NetBSD happy compiled and tested on OpenBSD and NetBSD
blob - 9954f7c641c45631058d66b9ab28189152b250dd
blob + a328daa51613824f1a4f8826c6662f3da447f947
--- recurse.c
+++ recurse.c
@@ -65,7 +65,7 @@ struct recurseentry {
} *rn1, *rn2, *rnp;
-static const char rcsid[] = "$Id: recurse.c,v 1.14 2010/09/23 18:40:43 pbug Exp $";
+static const char rcsid[] = "$Id: recurse.c,v 1.15 2010/09/24 08:12:14 pbug Exp $";
/*
* INIT_RECURSE - initialize the recurse singly linked list
@@ -204,7 +204,8 @@ void
recurseloop(int sp, int *raw, DB *db)
{
int sel, ret;
- int maxso, len, slen = sizeof(struct sockaddr);
+ int maxso, len;
+ socklen_t slen = sizeof(struct sockaddr);
fd_set rset;
struct timeval tv;
struct srecurseheader rh;
@@ -231,16 +232,7 @@ recurseloop(int sp, int *raw, DB *db)
sr1->launched = 1;
type = lookup_zone(db, sr1->question, &sd, &lzerrno, (char *)fakereplystring, wildcard);
if (type < 0) {
- switch (lzerrno) {
- case ERR_NXDOMAIN:
- netlookup(db, sr1);
- break;
- case ERR_NOERROR:
- sr1->callback->hascallback--;
- free_question(sr1->question);
- free(sr1);
- break;
- }
+ netlookup(db, sr1);
} else {
sr1->callback->hascallback--;
free_question(sr1->question);
@@ -310,22 +302,9 @@ recurseloop(int sp, int *raw, DB *db)
type = lookup_zone(db, sr->question, &sd, &lzerrno, (char *)fakereplystring, wildcard);
if (type < 0) {
- switch (lzerrno) {
- case ERR_NXDOMAIN:
- if (netlookup(db, sr) < 0)
+ if (netlookup(db, sr) < 0)
continue;
- case ERR_NOERROR:
- memset(&sd, 0, sizeof(sd));
-
- if (get_soa(db, sr->question, &sd, wildcard) < 0)
- continue;
- reply_raw(db, sr, &sd, raw);
- free_question(sr->question);
- free(sr);
- continue;
- }
-
SLIST_INSERT_HEAD(&recurseshead, sr, entries);
} else {
syslog(LOG_DEBUG, "we had the record in our cache, reply action");
@@ -403,7 +382,7 @@ recurseloop(int sp, int *raw, DB *db)
goto remove;
}
- recurse_parse(db, sr1, buf, len);
+ recurse_parse(db, sr1, (u_char*)&buf, len);
type = lookup_zone(db, sr1->question, &sd, &lzerrno, (char *)fakereplystring, wildcard);
if (type < 0) {
repomaster@centroid.eu