aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2011-07-27 07:28:10 +0000
committerPhilipp Tölke <toelke@in.tum.de>2011-07-27 07:28:10 +0000
commit5a8f3d96350e14c517e09a5a668d5f4382ca6155 (patch)
tree88e259af767851af844c9b2035804ec4f4850a13 /src/vpn
parent12d2fb0c47f2ef0868c5a247d9acd70c86e8daeb (diff)
downloadgnunet-5a8f3d96350e14c517e09a5a668d5f4382ca6155.tar.gz
gnunet-5a8f3d96350e14c517e09a5a668d5f4382ca6155.zip
save the dns-tunnel
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-service-dns.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c
index 168446156..01ac890ab 100644
--- a/src/vpn/gnunet-service-dns.c
+++ b/src/vpn/gnunet-service-dns.c
@@ -43,6 +43,11 @@
43struct GNUNET_MESH_Handle *mesh_handle; 43struct GNUNET_MESH_Handle *mesh_handle;
44 44
45/** 45/**
46 * The tunnel to send queries
47 */
48static struct GNUNET_MESH_Tunnel* dns_tunnel;
49
50/**
46 * The UDP-Socket through which DNS-Resolves will be sent if they are not to be 51 * The UDP-Socket through which DNS-Resolves will be sent if they are not to be
47 * sent through gnunet. The port of this socket will not be hijacked. 52 * sent through gnunet. The port of this socket will not be hijacked.
48 */ 53 */
@@ -261,13 +266,14 @@ send_mesh_query (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
261 266
262 struct tunnel_cls *cls_ = (struct tunnel_cls*)cls; 267 struct tunnel_cls *cls_ = (struct tunnel_cls*)cls;
263 268
264 cls_->tunnel = GNUNET_MESH_peer_request_connect_by_type(mesh_handle, 269 if (NULL == dns_tunnel)
265 GNUNET_TIME_UNIT_HOURS, 270 dns_tunnel = GNUNET_MESH_peer_request_connect_by_type(mesh_handle,
266 GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER, 271 GNUNET_TIME_UNIT_HOURS,
267 mesh_connect, 272 GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER,
268 NULL, 273 mesh_connect,
269 cls_); 274 NULL,
270 275 cls_);
276 cls_->tunnel = dns_tunnel;
271 remote_pending[cls_->dns.s.id] = cls_; 277 remote_pending[cls_->dns.s.id] = cls_;
272} 278}
273 279