[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 17/75: add LEHO records to DNS record sets if we k
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 17/75: add LEHO records to DNS record sets if we know them from GNS2DNS |
Date: |
Thu, 09 Aug 2018 23:58:14 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 3ec6a0f2b110771d09f407b47c3d56b2bcf12848
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jun 7 16:17:04 2018 +0200
add LEHO records to DNS record sets if we know them from GNS2DNS
---
src/gns/gnunet-service-gns_resolver.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/gns/gnunet-service-gns_resolver.c
b/src/gns/gnunet-service-gns_resolver.c
index c915c616a..809bde8f9 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -368,6 +368,12 @@ struct GNS_ResolverHandle
char *name;
/**
+ * Legacy Hostname to use if we encountered GNS2DNS record
+ * and thus can deduct the LEHO from that transition.
+ */
+ char *leho;
+
+ /**
* DLL of results we got from DNS.
*/
struct DnsResult *dns_result_head;
@@ -960,6 +966,12 @@ dns_result_parser (void *cls,
af = AF_UNSPEC;
break;
}
+ if (NULL != rh->leho)
+ add_dns_result (rh,
+ GNUNET_TIME_UNIT_HOURS.rel_value_us,
+ GNUNET_GNSRECORD_TYPE_LEHO,
+ strlen (rh->leho),
+ rh->leho);
rh->std_resolve = GNUNET_RESOLVER_ip_get (rh->name,
af,
DNS_LOOKUP_TIMEOUT,
@@ -974,8 +986,8 @@ dns_result_parser (void *cls,
/* convert from (parsed) DNS to (binary) GNS format! */
rd_count = p->num_answers + p->num_authority_records +
p->num_additional_records;
{
- struct GNUNET_GNSRECORD_Data rd[rd_count];
- unsigned int skip;
+ struct GNUNET_GNSRECORD_Data rd[rd_count + 1]; /* +1 for LEHO */
+ int skip;
char buf[UINT16_MAX];
size_t buf_off;
size_t buf_start;
@@ -1099,11 +1111,23 @@ dns_result_parser (void *cls,
skip++;
continue;
}
+ } /* end of for all records in answer */
+ if (NULL != rh->leho)
+ {
+ rd[rd_count - skip].record_type = GNUNET_GNSRECORD_TYPE_LEHO;
+ rd[rd_count - skip].flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
+ rd[rd_count - skip].expiration_time =
GNUNET_TIME_UNIT_HOURS.rel_value_us;
+ rd[rd_count - skip].data = rh->leho;
+ rd[rd_count - skip].data_size = strlen (rh->leho);
+ skip--; /* skip one LESS */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Adding LEHO %s\n",
+ rh->leho);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Returning DNS response for `%s' with %u answers\n",
rh->ac_tail->label,
- (unsigned int) p->num_answers);
+ (unsigned int) (rd_count - skip));
rh->proc (rh->proc_cls,
rd_count - skip,
rd);
@@ -1172,6 +1196,7 @@ recursive_dns_resolution (struct GNS_ResolverHandle *rh)
rh->original_dns_id = p->id;
GNUNET_assert (NULL != ac->authority_info.dns_authority.dns_handle);
GNUNET_assert (NULL == rh->dns_request);
+ rh->leho = GNUNET_strdup (ac->label);
rh->dns_request = GNUNET_DNSSTUB_resolve
(ac->authority_info.dns_authority.dns_handle,
dns_request,
dns_request_length,
@@ -2830,6 +2855,7 @@ GNS_resolver_lookup_cancel (struct GNS_ResolverHandle *rh)
dr);
GNUNET_free (dr);
}
+ GNUNET_free_non_null (rh->leho);
GNUNET_free (rh->name);
GNUNET_free (rh);
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 02/75: removed jsonapi structures, (continued)
- [GNUnet-SVN] [gnunet] 02/75: removed jsonapi structures, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 08/75: Add GPL2 licensed openrc service file, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 09/75: gnunet-bugreport: GNUtls->GnuTLS, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 10/75: fix NPE, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 14/75: guix-env.scm: Add python2-future., gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 15/75: rps profiler: summarize statistics, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 16/75: add option to disable v6, do not pass chunked encoding along, enable bypass of cert validation, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 06/75: extend the list of known package maintainers, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 07/75: cleanup identity rest api, removed jsonapi includes, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 18/75: add -z option to gnunet-namestore-fcfsd, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 17/75: add LEHO records to DNS record sets if we know them from GNS2DNS,
gnunet <=
- [GNUnet-SVN] [gnunet] 19/75: add -z option to gnunet-namestore-fcfsd, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 22/75: fix the stupid, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 11/75: README rework part 1, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 29/75: Fix the link to the preliminary documentation, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 23/75: config: file name expansion in all -f cases, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 26/75: doc: create system specific folder and move files into it, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 25/75: rps profiler: add correct make rule, util, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 37/75: ensure DHT never accepts or passes along expired blocks, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 39/75: rps profiler: cleaned debug output, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 30/75: remove crypto_bug.c, gnunet, 2018/08/09