From d1dd07145bb3db5c6fd77c55aea762eb79ab3b5c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 10 Oct 2005 22:34:06 +0000 Subject: * rename avahi_service_name_snprint() to avahi_service_name_join() * add avahi_service_name_split() and make everything use it * change avahi_normalize_name() to work on a supplied buffer instead of malloc'ed memory. * add avahi_normalize_name_strdup() that retains the old behaviour avahi_normalize_name() * same thing for avahi_get_host_name()/avahi_get_host_name_strdup() * Rewrite domain name escaping and validity checking code * Remove superfluous memory allocationsfrom various browsers and do some other major cleanups * add new global macro AVAHI_CHECK_VALIDITY_RETURN_NULL() and modify many things to make use of it * add AVAHI_LABEL_MAX * patch everything to make use of AVAHI_LABEL_MAX and AVAHI_DOMAIN_NAME_MAX * add pretty printing for NS records * add partial pretty printing for SOA records * add many more validity checks to various user API functions git-svn-id: file:///home/lennart/svn/public/avahi/trunk@708 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/dns.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'avahi-core/dns.c') diff --git a/avahi-core/dns.c b/avahi-core/dns.c index 9412470..71ec0ce 100644 --- a/avahi-core/dns.c +++ b/avahi-core/dns.c @@ -165,7 +165,6 @@ uint8_t* avahi_dns_packet_append_name(AvahiDnsPacket *p, const char *name) { const char *pname; char label[64], *u; - /* Check whether we can compress this name. */ if (p->name_table && (prev = avahi_hashmap_lookup(p->name_table, name))) { @@ -366,7 +365,7 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_ } else first_label = 0; - if (!(avahi_escape_label(AVAHI_DNS_PACKET_DATA(p) + idx, n, &ret_name, &l))) + if (!(avahi_escape_label((char*) AVAHI_DNS_PACKET_DATA(p) + idx, n, &ret_name, &l))) return -1; idx += n; @@ -519,6 +518,7 @@ AvahiRecord* avahi_dns_packet_consume_record(AvahiDnsPacket *p, int *ret_cache_f switch (type) { case AVAHI_DNS_TYPE_PTR: case AVAHI_DNS_TYPE_CNAME: + case AVAHI_DNS_TYPE_NS: /* avahi_log_debug("ptr"); */ @@ -678,8 +678,9 @@ uint8_t* avahi_dns_packet_append_record(AvahiDnsPacket *p, AvahiRecord *r, int c switch (r->key->type) { case AVAHI_DNS_TYPE_PTR: - case AVAHI_DNS_TYPE_CNAME : - + case AVAHI_DNS_TYPE_CNAME: + case AVAHI_DNS_TYPE_NS: + if (!(avahi_dns_packet_append_name(p, r->data.ptr.name))) goto fail; -- cgit