]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Fix bug 273.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Mon, 21 Sep 2009 07:57:55 +0000 (07:57 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Mon, 21 Sep 2009 07:57:55 +0000 (07:57 +0000)
Changelog
host2wire.c

index 1ffbb03ef8c4549cc7a24f0869c86fbbf1eba801..5431d09c92327947fd735c8d36aac679cfb60c6a 100644 (file)
--- 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).
index b843914f588c1ff515b8d8c285d9c0901a090498..c1f0f0dc5dcec3a577695a7ffb76e8841b9a98c9 100644 (file)
@@ -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);
        }