1
diff -ur maradns-1.2.12.03.orig/server/MaraDNS.c maradns-1.2.12.03/server/MaraDNS.c
2
--- maradns-1.2.12.03.orig/server/MaraDNS.c 2006-10-07 10:35:32.000000000 -0500
3
+++ maradns-1.2.12.03/server/MaraDNS.c 2006-10-07 10:42:06.000000000 -0500
6
int udperror(int sock,js_string *raw, struct sockaddr_in *from,
7
js_string *question, int error,
8
- char *why,int min_log_level, int rd_val, conn *ect) {
9
+ char *why,int min_log_level, int rd_val, conn *ect,int log_msg) {
13
int len_inet = sizeof(struct sockaddr);
15
- if(log_level >= min_log_level) {
16
+ if(log_level >= min_log_level && log_msg == 1) {
18
zjlog(L_BAD_QUERY,raw); /* "Bad query received: " */
19
if(ect != 0 && ect->type == 4) {
23
udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpsuccess",2,
28
/* Clean up the seenlist_where list */
32
udperror(sock,most,client,0,SERVER_FAIL,"compression failure",2,
41
udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpany",2,
46
/* Clean up the seenlist_where list
48
if(compress_data(most,ar) == JS_ERROR) {
50
udperror(sock,most,client,0,SERVER_FAIL,"compression failure",2,
54
if(synth_ns_record != 0) { js_destroy(synth_ns_record); }
57
if(synth_ns_record != 0) { js_destroy(synth_ns_record); }
59
udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpstar",2,
66
if(compress_data(most,compressed) == JS_ERROR) {
67
js_destroy(compressed);
68
udperror(sock,most,client,0,SERVER_FAIL,"Compression failure",2,
76
js_destroy(compressed);
77
udperror(sock,most,client,0,SERVER_FAIL,"giveerror in udpnotfound",2,
85
if(read_hdr(raw,&header) == JS_ERROR) { /* Something went wrong,
86
return error "Format error" */
87
- udperror(sock,raw,0,0,FORMAT_ERROR,"Couldn't get header",2,0,ect);
88
+ udperror(sock,raw,0,0,FORMAT_ERROR,"Couldn't get header",2,0,ect,1);
93
if(header.qdcount != 1) {
94
if(no_fingerprint != 1)
95
udperror(sock,raw,0,0,NOT_IMPLEMENTED,"Qdcount not 1",2,
96
- desires_recursion,ect);
97
+ desires_recursion,ect,1);
101
@@ -3017,7 +3017,7 @@
102
if(raw->unit_count < 14) {
103
if(no_fingerprint != 1)
104
udperror(sock,raw,0,0,FORMAT_ERROR,"bad question hdr",2,
105
- desires_recursion,ect);
106
+ desires_recursion,ect,1);
110
@@ -3026,7 +3026,7 @@
111
if(length < 0 || length > 255) {
112
if(no_fingerprint != 1)
113
udperror(sock,raw,0,0,FORMAT_ERROR,"bad question length",2,
114
- desires_recursion,ect);
115
+ desires_recursion,ect,1);
119
@@ -3034,7 +3034,7 @@
120
and 4 for the type and class */
121
if(no_fingerprint != 1)
122
udperror(sock,raw,0,0,FORMAT_ERROR,"question doesn't fit",2,
123
- desires_recursion,ect);
124
+ desires_recursion,ect,1);
128
@@ -3042,13 +3042,13 @@
129
if((lookfor = js_create(256,1)) == 0) {
130
if(no_fingerprint != 1)
131
udperror(sock,raw,0,0,SERVER_FAIL,
132
- "can't create lookfor string",2,desires_recursion,ect);
133
+ "can't create lookfor string",2,desires_recursion,ect,1);
136
if((origq = js_create(256,1)) == 0) {
138
udperror(sock,raw,0,0,SERVER_FAIL,"can't create origq string",2,
139
- desires_recursion,ect);
140
+ desires_recursion,ect,1);
144
@@ -3063,7 +3063,7 @@
145
/* Since TinyDNS also returns NOT_IMPLEMENTED here, no need for
146
a fingerprint check. */
147
udperror(sock,raw,0,lookfor,NOT_IMPLEMENTED,"non-0 opcode",2,
148
- desires_recursion,ect);
149
+ desires_recursion,ect,1);
153
@@ -3073,7 +3073,7 @@
154
*(raw->string + length + 15) != 1) {
155
if(no_fingerprint != 1)
156
udperror(sock,raw,0,lookfor,NOT_IMPLEMENTED,"Class not 1",2,
157
- desires_recursion,ect);
158
+ desires_recursion,ect,1);
162
@@ -3538,7 +3538,7 @@
165
udperror(sock,raw,0,0,REFUSED,
166
- "I'm sorry Dave (recurse attempt)",3,desires_recursion,ect);
167
+ "I'm sorry Dave (recurse attempt)",3,desires_recursion,ect,1);
171
@@ -3760,7 +3760,7 @@
173
if(no_fingerprint != 1)
174
udperror(sock,raw,0,lookfor,SERVER_FAIL,
175
- "serv_fail in proc_query",2,desires_recursion,ect);
176
+ "serv_fail in proc_query",2,desires_recursion,ect,1);
180
@@ -3769,7 +3769,7 @@
182
if(no_fingerprint != 1)
183
udperror(sock,raw,0,lookfor,NOT_IMPLEMENTED,
184
- "not_impl in proc_query",2,desires_recursion,ect);
185
+ "not_impl in proc_query",2,desires_recursion,ect,1);
189
diff -ur maradns-1.2.12.03.orig/server/recursive.c maradns-1.2.12.03/server/recursive.c
190
--- maradns-1.2.12.03.orig/server/recursive.c 2006-08-14 15:02:07.000000000 -0500
191
+++ maradns-1.2.12.03/server/recursive.c 2006-10-07 10:42:54.000000000 -0500
193
extern int udperror(int sock,js_string *raw, struct sockaddr_in *from,
195
int error,char *why, int min_log_level, int rd_val,
197
+ conn *ect,int log_msg);
198
extern int udpnotfound(rr *where, int id, int sock,
199
struct sockaddr_in *client,js_string *query,
200
int qtype, int rd_val, conn *ect,
201
@@ -3202,7 +3202,7 @@
204
udperror(sock,synthesized_header,&client,query,SERVER_FAIL,
205
- "No reply from remote servers",2,1,0);
206
+ "No reply from remote servers",2,1,0,0);
207
js_destroy(synthesized_header);
210
@@ -3236,7 +3236,7 @@
213
udperror(sock,synthesized_header,&client,query,SERVER_FAIL,
214
- "No reply from remote servers",2,1,0);
215
+ "No reply from remote servers",2,1,0,0);
216
js_destroy(synthesized_header);
219
@@ -3503,7 +3503,7 @@
222
udperror(sock,synthesized_header,&client,query,FORMAT_ERROR,
223
- "Didn't spawn thread",2,1,0);
224
+ "Didn't spawn thread",2,1,0,0);
225
js_destroy(synthesized_header);