From: Lennart Poettering Date: Thu, 12 Apr 2007 20:53:56 +0000 (+0000) Subject: allow adding of generic DNS RRs properly. Patch from Sjoerd Simons again (closes... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=b7e1f69e270e38642305d9064e9ca8051419b52c;p=catta allow adding of generic DNS RRs properly. Patch from Sjoerd Simons again (closes #130) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1407 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/dns.c b/avahi-core/dns.c index 614c396..0206ec7 100644 --- a/avahi-core/dns.c +++ b/avahi-core/dns.c @@ -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;