X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fdns.c;h=5213e97eb45e8e14e48d9163174c83ffa5acde04;hb=54d7450ef8b085110c380d4263794deffa5edda4;hp=5addf53c4139a7d68495b36fd97ccbec0b861644;hpb=c0244c2448a5504581ae24e78b5859760b999b8e;p=catta diff --git a/avahi-core/dns.c b/avahi-core/dns.c index 5addf53..5213e97 100644 --- a/avahi-core/dns.c +++ b/avahi-core/dns.c @@ -482,7 +482,7 @@ AvahiRecord* avahi_dns_packet_consume_record(AvahiDnsPacket *p, gboolean *ret_ca start = avahi_dns_packet_get_rptr(p); - r = avahi_record_new_full(name, class, type); + r = avahi_record_new_full(name, class, type, ttl); switch (type) { case AVAHI_DNS_TYPE_PTR: @@ -577,8 +577,6 @@ AvahiRecord* avahi_dns_packet_consume_record(AvahiDnsPacket *p, gboolean *ret_ca /* Check if we read enough data */ if ((guint8*) avahi_dns_packet_get_rptr(p) - (guint8*) start != rdlength) goto fail; - - r->ttl = ttl; return r; @@ -618,7 +616,7 @@ guint8* avahi_dns_packet_append_key(AvahiDnsPacket *p, AvahiKey *k, gboolean uni if (!(t = avahi_dns_packet_append_name(p, k->name)) || !avahi_dns_packet_append_uint16(p, k->type) || - !avahi_dns_packet_append_uint16(p, k->class | (unicast_response ? AVAHI_DNS_UNICAST_RESPONSE : 0))) { + !avahi_dns_packet_append_uint16(p, k->clazz | (unicast_response ? AVAHI_DNS_UNICAST_RESPONSE : 0))) { p->size = size; return NULL; } @@ -637,7 +635,7 @@ guint8* avahi_dns_packet_append_record(AvahiDnsPacket *p, AvahiRecord *r, gboole if (!(t = avahi_dns_packet_append_name(p, r->key->name)) || !avahi_dns_packet_append_uint16(p, r->key->type) || - !avahi_dns_packet_append_uint16(p, cache_flush ? (r->key->class | AVAHI_DNS_CACHE_FLUSH) : (r->key->class &~ AVAHI_DNS_CACHE_FLUSH)) || + !avahi_dns_packet_append_uint16(p, cache_flush ? (r->key->clazz | AVAHI_DNS_CACHE_FLUSH) : (r->key->clazz &~ AVAHI_DNS_CACHE_FLUSH)) || !avahi_dns_packet_append_uint32(p, (max_ttl && r->ttl > max_ttl) ? max_ttl : r->ttl) || !(l = avahi_dns_packet_append_uint16(p, 0))) goto fail;