summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/ldns-chaos.12
-rw-r--r--examples/ldns-dane.1.in2
-rw-r--r--examples/ldns-dpa.12
-rw-r--r--examples/ldns-gen-zone.12
-rw-r--r--examples/ldns-key2ds.12
-rw-r--r--examples/ldns-keyfetcher.12
-rw-r--r--examples/ldns-keygen.12
-rw-r--r--examples/ldns-keygen.c4
-rw-r--r--examples/ldns-mx.12
-rw-r--r--examples/ldns-notify.12
-rw-r--r--examples/ldns-notify.c2
-rw-r--r--examples/ldns-nsec3-hash.12
-rw-r--r--examples/ldns-nsec3-hash.c1
-rw-r--r--examples/ldns-read-zone.12
-rw-r--r--examples/ldns-resolver.12
-rw-r--r--examples/ldns-revoke.12
-rw-r--r--examples/ldns-rrsig.12
-rw-r--r--examples/ldns-signzone.12
-rw-r--r--examples/ldns-signzone.c6
-rw-r--r--examples/ldns-test-edns.12
-rw-r--r--examples/ldns-testns.16
-rw-r--r--examples/ldns-testns.c9
-rw-r--r--examples/ldns-testpkts.c43
-rw-r--r--examples/ldns-testpkts.h5
-rw-r--r--examples/ldns-update.12
-rw-r--r--examples/ldns-verify-zone.1.in2
-rw-r--r--examples/ldns-version.12
-rw-r--r--examples/ldns-walk.12
-rw-r--r--examples/ldns-walk.c15
-rw-r--r--examples/ldns-zcat.12
-rw-r--r--examples/ldns-zsplit.12
-rw-r--r--examples/ldnsd.12
32 files changed, 97 insertions, 40 deletions
diff --git a/examples/ldns-chaos.1 b/examples/ldns-chaos.1
index e9b7bf46dc95..6cb7a94c2e80 100644
--- a/examples/ldns-chaos.1
+++ b/examples/ldns-chaos.1
@@ -18,7 +18,7 @@ each address for its \fIversion.bind\fR and \fIhostname.bind\fR.
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-dane.1.in b/examples/ldns-dane.1.in
index a3d83a227fff..e87c27c2899c 100644
--- a/examples/ldns-dane.1.in
+++ b/examples/ldns-dane.1.in
@@ -170,7 +170,7 @@ unbound-anchor(8)
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to \fIldns-team@nlnetlabs.nl\fR.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2012 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-dpa.1 b/examples/ldns-dpa.1
index 6ff9eb323d4e..c3239f0c09d5 100644
--- a/examples/ldns-dpa.1
+++ b/examples/ldns-dpa.1
@@ -143,7 +143,7 @@ Print all query packets seen on the specified interface.
Written by Jelte Jansen for NLnetLabs.
.SH REPORTING BUGS
-Report bugs to <jelte@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-gen-zone.1 b/examples/ldns-gen-zone.1
index 0e5a0dc678d8..db6bca6342d3 100644
--- a/examples/ldns-gen-zone.1
+++ b/examples/ldns-gen-zone.1
@@ -77,7 +77,7 @@ Initially written by Marco Davids, several modifications added by Miek
Gieben, both from SIDN.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH BUGS
Only undiscovered ones.
diff --git a/examples/ldns-key2ds.1 b/examples/ldns-key2ds.1
index 5571777dbc7a..6225eef57ea2 100644
--- a/examples/ldns-key2ds.1
+++ b/examples/ldns-key2ds.1
@@ -44,7 +44,7 @@ Use SHA384 as the hash function
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-keyfetcher.1 b/examples/ldns-keyfetcher.1
index 6ddc14eacf88..13931fb66b29 100644
--- a/examples/ldns-keyfetcher.1
+++ b/examples/ldns-keyfetcher.1
@@ -56,7 +56,7 @@ The filenames will be of the format K<file>.+<alg>.+<keytag>.key
Written by Jelte Jansen for NLnet Labs.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2006 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-keygen.1 b/examples/ldns-keygen.1
index 4bb9fec2dd70..7e52a60bf2af 100644
--- a/examples/ldns-keygen.1
+++ b/examples/ldns-keygen.1
@@ -61,7 +61,7 @@ Show the version and exit
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005-2008 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-keygen.c b/examples/ldns-keygen.c
index 2f690b698223..351fc1b2f2e5 100644
--- a/examples/ldns-keygen.c
+++ b/examples/ldns-keygen.c
@@ -75,9 +75,13 @@ create_symlink(const char *symlink_destination, const char *symlink_name)
if (!symlink_name)
return result; /* no arg "-s" at all */
+#ifdef HAVE_SYMLINK
if ((result = symlink(symlink_destination, symlink_name)) == -1) {
fprintf(stderr, "Unable to create symlink %s -> %s: %s\n", symlink_name, symlink_destination, strerror(errno));
}
+#else
+ fprintf(stderr, "Unable to create symlink %s -> %s: no symlink()\n", symlink_name, symlink_destination);
+#endif
return result;
}
diff --git a/examples/ldns-mx.1 b/examples/ldns-mx.1
index cad97abcd82b..ec110cbabcb9 100644
--- a/examples/ldns-mx.1
+++ b/examples/ldns-mx.1
@@ -15,7 +15,7 @@ ldns-mx \- print out the mx record(s) for a domain
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-notify.1 b/examples/ldns-notify.1
index c7fbb6f70922..b77b0d4bbe23 100644
--- a/examples/ldns-notify.1
+++ b/examples/ldns-notify.1
@@ -62,7 +62,7 @@ acknowledgement to the notify message, and a failure exit code otherwise.
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-notify.c b/examples/ldns-notify.c
index bfd1238475ec..0c4f68dfcc90 100644
--- a/examples/ldns-notify.c
+++ b/examples/ldns-notify.c
@@ -39,7 +39,7 @@ usage(void)
fprintf(stderr, "\t-r num\t\tmax number of retries (%d)\n",
max_num_retry);
fprintf(stderr, "\t-h\t\tPrint this help information\n\n");
- fprintf(stderr, "Report bugs to <ldns-team@nlnetlabs.nl>\n");
+ fprintf(stderr, "Report bugs to <dns-team@nlnetlabs.nl>\n");
exit(1);
}
diff --git a/examples/ldns-nsec3-hash.1 b/examples/ldns-nsec3-hash.1
index 1b0f70ce395c..9fd5bd5f1283 100644
--- a/examples/ldns-nsec3-hash.1
+++ b/examples/ldns-nsec3-hash.1
@@ -26,7 +26,7 @@ Use count iterations for the hash calculation.
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2008 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-nsec3-hash.c b/examples/ldns-nsec3-hash.c
index f9325d3bd525..f04f1aabb92f 100644
--- a/examples/ldns-nsec3-hash.c
+++ b/examples/ldns-nsec3-hash.c
@@ -18,7 +18,6 @@
#ifdef HAVE_SSL
#include <openssl/conf.h>
-#include <openssl/engine.h>
#endif /* HAVE_SSL */
#define MAX_FILENAME_LEN 250
diff --git a/examples/ldns-read-zone.1 b/examples/ldns-read-zone.1
index 18c9f6dbf69d..11ecad71d981 100644
--- a/examples/ldns-read-zone.1
+++ b/examples/ldns-read-zone.1
@@ -105,7 +105,7 @@ Sort the zone before printing (this implies \-c)
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-resolver.1 b/examples/ldns-resolver.1
index 2392606881f5..de7c2593c846 100644
--- a/examples/ldns-resolver.1
+++ b/examples/ldns-resolver.1
@@ -18,7 +18,7 @@ be parsed successfully.
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-revoke.1 b/examples/ldns-revoke.1
index 5a16244dac42..3a8ee4b1dbdd 100644
--- a/examples/ldns-revoke.1
+++ b/examples/ldns-revoke.1
@@ -19,7 +19,7 @@ Write the result to stdout instead of a file
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2008 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-rrsig.1 b/examples/ldns-rrsig.1
index d64b9f3ba4d9..8262e3d44dcb 100644
--- a/examples/ldns-rrsig.1
+++ b/examples/ldns-rrsig.1
@@ -22,7 +22,7 @@ If the second argument \fBtype\fR is given the RRSIG covering that type will be
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-signzone.1 b/examples/ldns-signzone.1
index 68f9f77376a2..b1cdeebf9172 100644
--- a/examples/ldns-signzone.1
+++ b/examples/ldns-signzone.1
@@ -186,7 +186,7 @@ Written by the ldns team as an example for ldns usage.
Portions of engine support by Vadim Penzin <vadim@penzin.net>.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005-2008 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-signzone.c b/examples/ldns-signzone.c
index 9425833e53b6..509a023d1e24 100644
--- a/examples/ldns-signzone.c
+++ b/examples/ldns-signzone.c
@@ -22,8 +22,12 @@
#include <ldns/keys.h>
#include <openssl/conf.h>
-#ifndef OPENSSL_NO_ENGINE
+#if defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
#include <openssl/engine.h>
+#else
+# ifndef OPENSSL_NO_ENGINE
+# define OPENSSL_NO_ENGINE
+# endif
#endif
#include <openssl/err.h>
diff --git a/examples/ldns-test-edns.1 b/examples/ldns-test-edns.1
index 2659ccc47acd..5f703d7c947f 100644
--- a/examples/ldns-test-edns.1
+++ b/examples/ldns-test-edns.1
@@ -34,7 +34,7 @@ IP address: 0 is OK, 1 is failure, 2 is some sort of network failure.
.SH AUTHOR
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2010 NLnet Labs. This is free software. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
diff --git a/examples/ldns-testns.1 b/examples/ldns-testns.1
index e21bcf08a902..4164690bfffb 100644
--- a/examples/ldns-testns.1
+++ b/examples/ldns-testns.1
@@ -109,6 +109,10 @@ SECTION AUTHORITY
SECTION ADDITIONAL
<RRs, one per line>
+HEX_EDNSDATA_BEGIN
+<Hex data of an EDNS option>
+HEX_EDNSDATA_END
+
EXTRA_PACKET ; follow with SECTION, REPLY for more packets.
HEX_ANSWER_BEGIN ; follow with hex data
; this replaces any answer packet constructed
@@ -124,7 +128,7 @@ ENTRY_END
.SH AUTHOR
Written by the ldns team as an example for ldns usage, and for testing purposes.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2006-2008 NLnet Labs. This is free software. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
diff --git a/examples/ldns-testns.c b/examples/ldns-testns.c
index f1b9c7228d24..689bbd1c9342 100644
--- a/examples/ldns-testns.c
+++ b/examples/ldns-testns.c
@@ -63,6 +63,9 @@
<RRs, one per line>
SECTION ADDITIONAL
<RRs, one per line>
+ HEX_EDNSDATA_BEGIN
+ <Hex data of an EDNS option>
+ HEX_EDNSDATA_END
EXTRA_PACKET ; follow with SECTION, REPLY for more packets.
HEX_ANSWER_BEGIN ; follow with hex data
; this replaces any answer packet constructed
@@ -88,6 +91,12 @@ SECTION ANSWER
www.nlnetlabs.nl. IN A 195.169.215.155
SECTION AUTHORITY
nlnetlabs.nl. IN NS www.nlnetlabs.nl.
+HEX_EDNSDATA_BEGIN
+00 03 ; NSID
+00 04 ; LENGTH
+4E 53 ; NS
+49 44 ; ID
+HEX_EDNSDATA_END
ENTRY_END
ENTRY_BEGIN
diff --git a/examples/ldns-testpkts.c b/examples/ldns-testpkts.c
index 05a54c583888..033b96013784 100644
--- a/examples/ldns-testpkts.c
+++ b/examples/ldns-testpkts.c
@@ -85,6 +85,7 @@ entry_add_reply(struct entry* entry)
pkt->packet_sleep = 0;
pkt->reply = ldns_pkt_new();
pkt->reply_from_hex = NULL;
+ pkt->raw_ednsdata = NULL;
/* link at end */
while(*p)
p = &((*p)->next);
@@ -129,6 +130,13 @@ static void matchline(char* line, struct entry* e)
e->ixfr_soa_serial = (uint32_t)strtol(parse, (char**)&parse, 10);
while(isspace((int)*parse))
parse++;
+ } else if(str_keyword(&parse, "udp_size")) {
+ if(*parse != '=' && *parse != ':')
+ error("expected = or : in MATCH: %s", line);
+ parse++;
+ e->match_udp_size = (uint32_t)strtol(parse, (char**)&parse, 10);
+ while(isspace((int)*parse))
+ parse++;
} else {
error("could not parse MATCH: '%s'", parse);
}
@@ -242,6 +250,7 @@ static struct entry* new_entry(void)
e->match_serial = false;
e->ixfr_soa_serial = 0;
e->match_transport = transport_any;
+ e->match_udp_size = 0;
e->reply_list = NULL;
e->copy_id = false;
e->copy_query = false;
@@ -324,11 +333,11 @@ data_buffer2wire(ldns_buffer *data_buffer)
size_t wirelen;
uint8_t *data_wire = (uint8_t *) ldns_buffer_begin(data_buffer);
uint8_t *wire = LDNS_XMALLOC(uint8_t, LDNS_MAX_PACKETLEN);
-
+
hexbuf = LDNS_XMALLOC(uint8_t, LDNS_MAX_PACKETLEN);
for (data_buf_pos = 0; data_buf_pos < ldns_buffer_position(data_buffer); data_buf_pos++) {
c = (int) data_wire[data_buf_pos];
-
+
if (state < 2 && !isascii(c)) {
/*verbose("non ascii character found in file: (%d) switching to raw mode\n", c);*/
state = 2;
@@ -502,14 +511,28 @@ read_entry(FILE* in, const char* name, int *lineno, uint32_t* default_ttl,
ldns_buffer_printf(hex_data_buffer, line);
} else if(str_keyword(&parse, "HEX_EDNSDATA_BEGIN")) {
hex_ednsdata_buffer = ldns_buffer_new(LDNS_MAX_PACKETLEN);
+
reading_hex_ednsdata = true;
} else if(str_keyword(&parse, "HEX_EDNSDATA_END")) {
+ ldns_buffer* edns = NULL;
if (!reading_hex_ednsdata) {
error("%s line %d: HEX_EDNSDATA_END read but no"
"HEX_EDNSDATA_BEGIN keyword seen", name, *lineno);
}
reading_hex_ednsdata = false;
+
+ edns = data_buffer2wire(hex_ednsdata_buffer);
+
+ /* add read-in EDNS directly to the reply */
+ ldns_pkt_set_edns_data(cur_reply->reply,
+ ldns_rdf_new_frm_data(LDNS_RDF_TYPE_UNKNOWN,
+ ldns_buffer_limit(edns),
+ ldns_buffer_begin(edns)));
+
+ /* store raw EDNS for matching */
cur_reply->raw_ednsdata = data_buffer2wire(hex_ednsdata_buffer);
+
+ ldns_buffer_free(edns);
ldns_buffer_free(hex_ednsdata_buffer);
hex_ednsdata_buffer = NULL;
} else if(reading_hex_ednsdata) {
@@ -741,9 +764,13 @@ find_match(struct entry* entries, ldns_pkt* query_pkt,
continue;
}
if(p->match_qname) {
- if(!get_owner(query_pkt) || !get_owner(reply) ||
- ldns_dname_compare(
- get_owner(query_pkt), get_owner(reply)) != 0) {
+ if (!get_owner(query_pkt) || !get_owner(reply)
+ || ( !p->copy_query
+ && ldns_dname_compare( get_owner(query_pkt)
+ , get_owner(reply)))
+ || ( p->copy_query
+ && !ldns_dname_match_wildcard( get_owner(query_pkt)
+ , get_owner(reply)))) {
verbose(3, "bad qname\n");
continue;
}
@@ -780,6 +807,12 @@ find_match(struct entry* entries, ldns_pkt* query_pkt,
verbose(3, "bad transport\n");
continue;
}
+ if(p->match_udp_size > 0 && transport == transport_udp && (
+ !ldns_pkt_edns(query_pkt) ||
+ ldns_pkt_edns_udp_size(query_pkt) < p->match_udp_size)) {
+ verbose(3, "bad udp_size\n");
+ continue;
+ }
if(p->match_all && !match_all(query_pkt, reply, p->match_ttl)) {
verbose(3, "bad allmatch\n");
continue;
diff --git a/examples/ldns-testpkts.h b/examples/ldns-testpkts.h
index 26a71dad8dd1..0a20d016ae48 100644
--- a/examples/ldns-testpkts.h
+++ b/examples/ldns-testpkts.h
@@ -49,6 +49,9 @@
; 'DO' will match only queries with DO bit set.
; 'noedns' matches queries without EDNS OPT records.
; 'ednsdata' matches queries to HEX_EDNS section.
+ ; 'udp_size=1232' makes the query match if:
+ ; udp_size in query edns0 field >= 1232,
+ ; or the query came over TCP.
MATCH [opcode] [qtype] [qname] [serial=<value>] [all] [ttl]
MATCH [UDP|TCP] DO
MATCH ...
@@ -185,6 +188,8 @@ struct entry {
uint32_t ixfr_soa_serial;
/** match on UDP/TCP */
enum transport_type match_transport;
+ /** match on edns udp size (larger or equal) */
+ uint16_t match_udp_size;
/** pre canned reply */
struct reply_packet *reply_list;
diff --git a/examples/ldns-update.1 b/examples/ldns-update.1
index f36b2683401a..4b1a8b332cd1 100644
--- a/examples/ldns-update.1
+++ b/examples/ldns-update.1
@@ -44,7 +44,7 @@ ldns-update my.example.org 1.2.3.4
Written by Jakob Schlyter and HÃ¥kan Olsson, as an addition to the ldns library from NLnet Labs.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-verify-zone.1.in b/examples/ldns-verify-zone.1.in
index c37cb7912a11..6bea57f0c153 100644
--- a/examples/ldns-verify-zone.1.in
+++ b/examples/ldns-verify-zone.1.in
@@ -107,7 +107,7 @@ unbound-anchor(8)
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2008 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-version.1 b/examples/ldns-version.1
index bf409a305a7f..102e5d356152 100644
--- a/examples/ldns-version.1
+++ b/examples/ldns-version.1
@@ -14,7 +14,7 @@ ldns-version \- print out the version of the ldns-library and tools on this syst
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-walk.1 b/examples/ldns-walk.1
index d4d1b6e79c17..0523b0dabbde 100644
--- a/examples/ldns-walk.1
+++ b/examples/ldns-walk.1
@@ -53,7 +53,7 @@ The full zone walk function is not complete yet, it does not correctly print del
Written by Jelte Jansen as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-walk.c b/examples/ldns-walk.c
index 3710098adb76..f320b99d6000 100644
--- a/examples/ldns-walk.c
+++ b/examples/ldns-walk.c
@@ -38,24 +38,22 @@ create_dname_plus_1(ldns_rdf *dname)
size_t i;
ldns_dname2canonical(dname);
- labellen = ldns_rdf_data(dname)[0];
if (verbosity >= 3) {
printf("Create +e for ");
ldns_rdf_print(stdout, dname);
printf("\n");
}
- if (labellen < 63) {
- wire = malloc(ldns_rdf_size(dname) + 1);
+ if (ldns_rdf_size(dname) < LDNS_MAX_DOMAINLEN) {
+ wire = malloc(ldns_rdf_size(dname) + 2);
if (!wire) {
fprintf(stderr, "Malloc error: out of memory?\n");
exit(127);
}
- wire[0] = labellen + 1;
- memcpy(&wire[1], ldns_rdf_data(dname) + 1, labellen);
- memcpy(&wire[labellen+1], ldns_rdf_data(dname) + labellen, ldns_rdf_size(dname) - labellen);
- wire[labellen+1] = (uint8_t) '\000';
+ wire[0] = (uint8_t) 1;
+ wire[1] = (uint8_t) '\000';
+ memcpy(&wire[2], ldns_rdf_data(dname), ldns_rdf_size(dname));
pos = 0;
- status = ldns_wire2dname(&newdname, wire, ldns_rdf_size(dname) + 1, &pos);
+ status = ldns_wire2dname(&newdname, wire, ldns_rdf_size(dname) + 2, &pos);
free(wire);
} else {
wire = malloc(ldns_rdf_size(dname));
@@ -63,6 +61,7 @@ create_dname_plus_1(ldns_rdf *dname)
fprintf(stderr, "Malloc error: out of memory?\n");
exit(127);
}
+ labellen = ldns_rdf_data(dname)[0];
wire[0] = labellen;
memcpy(&wire[1], ldns_rdf_data(dname) + 1, labellen);
memcpy(&wire[labellen], ldns_rdf_data(dname) + labellen, ldns_rdf_size(dname) - labellen);
diff --git a/examples/ldns-zcat.1 b/examples/ldns-zcat.1
index 4fd7ba6d7dbb..0c33c466a3fd 100644
--- a/examples/ldns-zcat.1
+++ b/examples/ldns-zcat.1
@@ -26,7 +26,7 @@ show the version number and exit
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005, 2006 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldns-zsplit.1 b/examples/ldns-zsplit.1
index 02dce404cfb8..be110b5b1c47 100644
--- a/examples/ldns-zsplit.1
+++ b/examples/ldns-zsplit.1
@@ -35,7 +35,7 @@ Show version number and exit.
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005, 2006 NLnet Labs. This is free software. There is NO
diff --git a/examples/ldnsd.1 b/examples/ldnsd.1
index 5b18058aba1b..2036b67dc2ea 100644
--- a/examples/ldnsd.1
+++ b/examples/ldnsd.1
@@ -18,7 +18,7 @@ This is NOT a full-fledged authoritative nameserver!
Written by the ldns team as an example for ldns usage.
.SH REPORTING BUGS
-Report bugs to <ldns-team@nlnetlabs.nl>.
+Report bugs to <dns-team@nlnetlabs.nl>.
.SH COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO