~ubuntu-branches/ubuntu/wily/maradns/wily-proposed

« back to all changes in this revision

Viewing changes to deadwood-3.2.05/update/3.1.01/deadwood-3.0.05-reset_rem.patch

  • Committer: Package Import Robot
  • Author(s): Dariusz Dwornikowski, Tomasz Buchert, Dariusz Dwornikowski
  • Date: 2015-03-27 18:34:08 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20150327183408-wnfachdkdjt96yu6
Tags: 2.0.11-1
[ Tomasz Buchert ]
* Imported Upstream version 2.0.11

[ Dariusz Dwornikowski ]
* d/patches: 
  - refreshed all patches for new deadwood version
  - removed generating of random prime on build (Closes: #785536) 
* d/rules: date taken from changelog (Closes: #785535)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- deadwood-3.0.05/src/DwSocket.h      2011-11-10 11:46:56.000000000 -0600
2
 
+++ deadwood-3.1.01/src/DwSocket.h      2011-11-19 17:09:42.375915964 -0600
3
 
@@ -1,4 +1,4 @@
4
 
-/* Copyright (c) 2007-2010 Sam Trenholme
5
 
+/* Copyright (c) 2007-2011 Sam Trenholme
6
 
  *
7
 
  * TERMS
8
 
  *
9
 
@@ -233,42 +233,6 @@
10
 
 /* Function for removing inflight data about a connection */
11
 
 void zap_inflight(dw_str *query);
12
 
 
13
 
-/* Make this also look like a function; this resets a given remote
14
 
- * UDP connection */
15
 
-
16
 
-#define reset_rem(a) if(rem[a].socket != INVALID_SOCKET) { \
17
 
-                        closesocket(rem[a].socket); \
18
 
-                        rem[a].socket = INVALID_SOCKET; } \
19
 
-                     rem[a].die = 0; \
20
 
-                     rem[a].remote_id = 0; \
21
 
-                     rem[a].retries = num_retries; \
22
 
-                     if(rem[a].ns != 0) { \
23
 
-                        dw_destroy(rem[a].ns); \
24
 
-                        rem[a].ns = 0; } \
25
 
-                     rem[a].is_upstream = 0; \
26
 
-                     if(rem[a].query != 0) { \
27
 
-                        zap_inflight(rem[a].query); \
28
 
-                        dw_destroy(rem[a].query); \
29
 
-                        rem[a].query = 0; } \
30
 
-                     rem[a].recurse_depth = 0; \
31
 
-                     rem[a].current_ns = -1; \
32
 
-                     rem[a].child_id = -1; \
33
 
-                     if(rem[a].glueless != 0) { \
34
 
-                        dw_destroy(rem[a].glueless); \
35
 
-                        rem[a].glueless = 0; } \
36
 
-                     if(rem[a].local != 0) { \
37
 
-                        int qq; \
38
 
-                        for(qq = 0; qq < rem[a].num_locals; qq++) { \
39
 
-                                if(rem[a].local[qq] != 0) { \
40
 
-                                        dw_destroy(rem[a].local[qq]-> \
41
 
-                                                orig_query); \
42
 
-                                        free(rem[a].local[qq]); \
43
 
-                                        rem[a].local[qq] = 0; } \
44
 
-                                } \
45
 
-                        free(rem[a].local); } \
46
 
-                     rem[a].local = 0; \
47
 
-                     rem[a].num_locals = 0;
48
 
-
49
 
 #define tcp_remote2local(a,b,c) tcp_local2remote(a,b,c)
50
 
 
51
 
 /* Function parameters */
52
 
@@ -278,6 +242,9 @@
53
 
 
54
 
 /* In DwSocket.c */
55
 
 
56
 
+/* Reset the values for a remote connection */
57
 
+void reset_rem(int_fast32_t a);
58
 
+
59
 
 /* Given a "client" that recvfrom/accept gave us (which has the IP and port
60
 
  * number hidden in it), extract the IP and port from that "client", put the
61
 
  * IP information in from_ip, and return a 16-bit number that has the port
62
 
--- deadwood-3.1.01/src/DwSocket.c.orig 2011-11-19 16:24:28.886280114 -0600
63
 
+++ deadwood-3.1.01/src/DwSocket.c      2011-11-19 17:09:53.302958916 -0600
64
 
@@ -95,6 +95,46 @@
65
 
 }
66
 
 #endif /* NO_INET_PTON */
67
 
 
68
 
+/* Reset the values for a remote connection */
69
 
+void reset_rem(int_fast32_t a) {
70
 
+       if(rem[a].socket != INVALID_SOCKET) { 
71
 
+               closesocket(rem[a].socket); 
72
 
+               rem[a].socket = INVALID_SOCKET; 
73
 
+       } 
74
 
+       rem[a].die = 0; 
75
 
+       rem[a].remote_id = 0; 
76
 
+       rem[a].retries = num_retries; 
77
 
+       if(rem[a].ns != 0) { 
78
 
+               dw_destroy(rem[a].ns); 
79
 
+               rem[a].ns = 0; 
80
 
+       } 
81
 
+       rem[a].is_upstream = 0; 
82
 
+       if(rem[a].query != 0) { 
83
 
+               zap_inflight(rem[a].query); 
84
 
+               dw_destroy(rem[a].query); 
85
 
+               rem[a].query = 0; 
86
 
+       } 
87
 
+       rem[a].recurse_depth = 0; 
88
 
+       rem[a].current_ns = -1; 
89
 
+       rem[a].child_id = -1; 
90
 
+       if(rem[a].glueless != 0) { 
91
 
+               dw_destroy(rem[a].glueless); 
92
 
+               rem[a].glueless = 0; 
93
 
+       } 
94
 
+       if(rem[a].local != 0) { 
95
 
+               int qq; 
96
 
+               for(qq = 0; qq < rem[a].num_locals; qq++) { 
97
 
+                       if(rem[a].local[qq] != 0) { 
98
 
+                               dw_destroy(rem[a].local[qq]->orig_query); 
99
 
+                               free(rem[a].local[qq]); 
100
 
+                               rem[a].local[qq] = 0; } 
101
 
+               } 
102
 
+               free(rem[a].local); 
103
 
+       } 
104
 
+       rem[a].local = 0; 
105
 
+       rem[a].num_locals = 0;
106
 
+}
107
 
+
108
 
 /* Configure the dns_do local bind structure.  Given an IP we
109
 
  * want to bind to, fill up the dns_udp structure with that IP
110
 
  * and set things up to bind to the dns_port port (normally 53, DNS).