allow adding of generic DNS RRs properly. Patch from Sjoerd Simons again (closes...
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Apr 2007 20:53:56 +0000 (20:53 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Apr 2007 20:53:56 +0000 (20:53 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1407 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/dns.c

index 614c396..0206ec7 100644 (file)
@@ -589,6 +589,7 @@ static int parse_rdata(AvahiDnsPacket *p, AvahiRecord *r, uint16_t rdlength) {
             if (rdlength > 0) {
 
                 r->data.generic.data = avahi_memdup(avahi_dns_packet_get_rptr(p), rdlength);
+                r->data.generic.size = rdlength; 
                 
                 if (avahi_dns_packet_skip(p, rdlength) < 0)
                     return -1;
@@ -754,7 +755,7 @@ static int append_rdata(AvahiDnsPacket *p, AvahiRecord *r) {
         default:
 
             if (r->data.generic.size)
-                if (avahi_dns_packet_append_bytes(p, r->data.generic.data, r->data.generic.size))
+                if (!avahi_dns_packet_append_bytes(p, r->data.generic.data, r->data.generic.size))
                     return -1;
 
             break;