diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -161,10 +161,31 @@ void tunnel_delete(tunnel *t) | |||
161 | free(t); | 161 | free(t); |
162 | } | 162 | } |
163 | 163 | ||
164 | int tunnel_in_delete_queue(tunnel *t) | ||
165 | { | ||
166 | tunnel_list *element; | ||
167 | |||
168 | LL_FOREACH(tunnels_to_delete, element) | ||
169 | { | ||
170 | if(element->tun == t) | ||
171 | { | ||
172 | return 1; | ||
173 | } | ||
174 | } | ||
175 | |||
176 | return 0; | ||
177 | } | ||
178 | |||
164 | void tunnel_queue_delete(tunnel *t) | 179 | void tunnel_queue_delete(tunnel *t) |
165 | { | 180 | { |
166 | tunnel_list *tunnel_list_entry = NULL; | 181 | tunnel_list *tunnel_list_entry = NULL; |
167 | 182 | ||
183 | if(tunnel_in_delete_queue(t)) | ||
184 | { | ||
185 | log_printf(L_DEBUG2, "Did not queue deleting tunnel #%d ptr %p - already queued\n", t->connid, t); | ||
186 | return; | ||
187 | } | ||
188 | |||
168 | log_printf(L_DEBUG2, "Queued deleting tunnel #%d ptr %p\n", t->connid, t); | 189 | log_printf(L_DEBUG2, "Queued deleting tunnel #%d ptr %p\n", t->connid, t); |
169 | 190 | ||
170 | tunnel_list_entry = calloc(sizeof(tunnel_list), 1); | 191 | tunnel_list_entry = calloc(sizeof(tunnel_list), 1); |