From: Wouter Wijngaards Date: Mon, 21 Sep 2009 07:57:55 +0000 (+0000) Subject: Fix bug 273. X-Git-Tag: release-1.6.2~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=befccddcc97864bfecf8d0e8d4486efd3bcfe6f8;p=thirdparty%2Fldns.git Fix bug 273. --- diff --git a/Changelog b/Changelog index 1ffbb03e..5431d09c 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ Fix print of ';' and readback of '\;' in names, also for '\\'. Fix parse of '\(' and '\)' in names. Also for file read. Also '\.' * Fix signature creation when TTLs are different for RRs in RRset. + * bug273: fix so EDNS rdata is included in pkt to wire conversion. 1.6.1 2009-09-14 * --enable-gost : use the GOST algorithm (experimental). diff --git a/host2wire.c b/host2wire.c index b843914f..c1f0f0dc 100644 --- a/host2wire.c +++ b/host2wire.c @@ -316,7 +316,13 @@ ldns_pkt2buffer_wire(ldns_buffer *buffer, const ldns_pkt *packet) edata[1] = ldns_pkt_edns_version(packet); ldns_write_uint16(&edata[2], ldns_pkt_edns_z(packet)); ldns_rr_set_ttl(edns_rr, ldns_read_uint32(edata)); + /* don't forget to add the edns rdata (if any) */ + if (packet->_edns_data) + ldns_rr_push_rdf (edns_rr, packet->_edns_data); (void)ldns_rr2buffer_wire(buffer, edns_rr, LDNS_SECTION_ADDITIONAL); + /* take the edns rdata back out of the rr before we free rr */ + if (packet->_edns_data) + ldns_rr_pop_rdf (edns_rr); ldns_rr_free(edns_rr); }