aboutsummaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-service-dns.c
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2011-10-26 12:44:01 +0000
committerPhilipp Tölke <toelke@in.tum.de>2011-10-26 12:44:01 +0000
commit9015eb2c40ca51f1adfe24d17f169ce19cfab4c6 (patch)
tree346dacea1e0ca76f6ad13b5c5a5573282d9bd05e /src/vpn/gnunet-service-dns.c
parente02328ef9988444880c36d108aed7ab531c9e3b2 (diff)
downloadgnunet-9015eb2c40ca51f1adfe24d17f169ce19cfab4c6.tar.gz
gnunet-9015eb2c40ca51f1adfe24d17f169ce19cfab4c6.zip
bugs
Diffstat (limited to 'src/vpn/gnunet-service-dns.c')
-rw-r--r--src/vpn/gnunet-service-dns.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c
index 2f413c763..00d93ab24 100644
--- a/src/vpn/gnunet-service-dns.c
+++ b/src/vpn/gnunet-service-dns.c
@@ -499,9 +499,12 @@ receive_mesh_answer (void *cls
499 int i = 0; 499 int i = 0;
500 500
501 while (i < ntohs(pdns->s.ancount) && 501 while (i < ntohs(pdns->s.ancount) &&
502 pdns->answers[i]->type != 28 && 502 ntohs(pdns->answers[i]->type) != 28 &&
503 pdns->answers[i]->type != 1) 503 ntohs(pdns->answers[i]->type) != 1)
504{
505 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Answer contains %d.\n", ntohs(pdns->answers[i]->type));
504 i++; 506 i++;
507}
505 508
506 if (i >= ntohs (pdns->s.ancount)) 509 if (i >= ntohs (pdns->s.ancount))
507 { 510 {
@@ -1005,14 +1008,18 @@ receive_query (void *cls
1005 cls_->hdr.size - sizeof (struct GNUNET_MessageHeader)); 1008 cls_->hdr.size - sizeof (struct GNUNET_MessageHeader));
1006 GNUNET_SCHEDULER_add_now (send_mesh_query, cls_); 1009 GNUNET_SCHEDULER_add_now (send_mesh_query, cls_);
1007 1010
1008 if (pdns->s.qdcount == 1) 1011 if (ntohs(pdns->s.qdcount) == 1)
1009 { 1012 {
1010 if (ntohs(pdns->queries[0]->qtype) == 1) 1013 if (ntohs(pdns->queries[0]->qtype) == 1)
1011 pdns->queries[0]->qtype = htons(28); 1014 pdns->queries[0]->qtype = htons(28);
1012 else if (ntohs(pdns->queries[0]->qtype) == 28) 1015 else if (ntohs(pdns->queries[0]->qtype) == 28)
1013 pdns->queries[0]->qtype = htons(1); 1016 pdns->queries[0]->qtype = htons(1);
1014 else 1017 else
1018{
1019 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "not sending second packet\n");
1015 goto outfree; 1020 goto outfree;
1021}
1022 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "sending second packet\n");
1016 struct dns_pkt *rdns = unparse_dns_packet (pdns); 1023 struct dns_pkt *rdns = unparse_dns_packet (pdns);
1017 size_t size = 1024 size_t size =
1018 sizeof (struct GNUNET_MESH_Tunnel *) + 1025 sizeof (struct GNUNET_MESH_Tunnel *) +