~ubuntu-branches/ubuntu/quantal/maradns/quantal

« back to all changes in this revision

Viewing changes to update/1.4.07/maradns-2.0.02-axfr_over_udp.patch

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2012-01-12 23:35:38 UTC
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20120112233538-5jkaqrh9nbqtf1ey
Tags: upstream-2.0.04+really1.4.09
ImportĀ upstreamĀ versionĀ 2.0.04+really1.4.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- maradns-2.0.03/server/MaraDNS.c.orig        2011-04-15 13:21:53.000000000 -0500
 
2
+++ maradns-2.0.03/server/MaraDNS.c     2011-04-15 13:33:19.000000000 -0500
 
3
@@ -505,6 +505,8 @@
 
4
           the reason for the error, the minimim log_level to log this
 
5
           error (with reason) with
 
6
    output: JS_ERROR on error, JS_SUCCESS on success
 
7
+
 
8
+   If error is -111, this means "truncated" (magic number)
 
9
 */
 
10
 
 
11
 int udperror(int sock,js_string *raw, struct sockaddr_in *from,
 
12
@@ -546,11 +548,20 @@
 
13
     header.opcode = 0;
 
14
     header.aa = 0; /* Errors are never authoritative (unless they are
 
15
                       NXDOMAINS, which this is not) */
 
16
-    header.tc = 0;
 
17
+   
 
18
+    if(error != -111) {
 
19
+        header.tc = 0;
 
20
+    } else {
 
21
+        header.tc = 1;
 
22
+    }
 
23
     header.rd = rd_val; /* RDBUG udperror */
 
24
     header.ra = 0;
 
25
     header.z = 0;
 
26
-    header.rcode = error;
 
27
+    if(error != -111) {
 
28
+        header.rcode = error;
 
29
+    } else {
 
30
+        header.rcode = 0;
 
31
+    }
 
32
     if(question == 0)
 
33
         header.qdcount = 0;
 
34
     else
 
35
@@ -2459,6 +2470,7 @@
 
36
     struct sockaddr_in *z; /* Makes certain ugly declarations readable */
 
37
     int always_not_there = 0;
 
38
     int rd_val = 0;
 
39
+    int not_impl_datatype = NOT_IMPLEMENTED;
 
40
 
 
41
 
 
42
     /* Sanity checks */
 
43
@@ -2589,10 +2601,15 @@
 
44
             return JS_SUCCESS;
 
45
     }
 
46
 
 
47
-    if(qtype >= 250 && qtype <= 254) { /* IXFR, AXFR, and 2 more */
 
48
+    if(qtype == 253 || qtype == 254 || qtype == 250) { /* MAILB, MAILA, TSIG */
 
49
         goto not_impl;
 
50
         }
 
51
 
 
52
+    if(qtype == 251 || qtype == 252) { /* IXFR, AXFR */
 
53
+       not_impl_datatype = -111;
 
54
+       goto not_impl;
 
55
+       }
 
56
+
 
57
     /* Set 'ip' to have the ip they are using MaraDNS from */
 
58
     z = (struct sockaddr_in *)ect->d;
 
59
     ip = htonl((z->sin_addr).s_addr);
 
60
@@ -3332,7 +3349,7 @@
 
61
         js_destroy(origq);
 
62
         js_destroy(lc);
 
63
         if(no_fingerprint != 1)
 
64
-            udperror(sock,raw,0,lookfor,NOT_IMPLEMENTED,
 
65
+            udperror(sock,raw,0,lookfor,not_impl_datatype,
 
66
                      "not_impl in proc_query",2,desires_recursion,ect,1);
 
67
         js_destroy(lookfor);
 
68
         return JS_ERROR;