diff options
Diffstat (limited to 'src/vpn/gnunet-service-dns.c')
-rw-r--r-- | src/vpn/gnunet-service-dns.c | 13 |
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 *) + |