From bec8eb97079a9f9a835b4629fb6144af0eaa1635 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 22 Aug 2005 08:56:57 +0000 Subject: [PATCH] fix some issues with host-name/address/service resolving git-svn-id: file:///home/lennart/svn/public/avahi/trunk@393 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/resolve-address.c | 2 +- avahi-core/resolve-host-name.c | 2 +- avahi-core/resolve-service.c | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/avahi-core/resolve-address.c b/avahi-core/resolve-address.c index fbf50ff..18c862c 100644 --- a/avahi-core/resolve-address.c +++ b/avahi-core/resolve-address.c @@ -121,7 +121,7 @@ static void record_browser_callback(AvahiSRecordBrowser*rr, AvahiIfIndex interfa assert(event == AVAHI_BROWSER_REMOVE); - if (avahi_record_equal_no_ttl(record, r->ptr_record)) { + if (r->ptr_record && avahi_record_equal_no_ttl(record, r->ptr_record)) { avahi_record_unref(r->ptr_record); r->ptr_record = NULL; diff --git a/avahi-core/resolve-host-name.c b/avahi-core/resolve-host-name.c index ae7ef78..d9c3341 100644 --- a/avahi-core/resolve-host-name.c +++ b/avahi-core/resolve-host-name.c @@ -141,7 +141,7 @@ static void record_browser_callback(AvahiSRecordBrowser*rr, AvahiIfIndex interfa assert(event == AVAHI_BROWSER_REMOVE); - if (avahi_record_equal_no_ttl(record, r->address_record)) { + if (r->address_record && avahi_record_equal_no_ttl(record, r->address_record)) { avahi_record_unref(r->address_record); r->address_record = NULL; diff --git a/avahi-core/resolve-service.c b/avahi-core/resolve-service.c index 333f257..173c34b 100644 --- a/avahi-core/resolve-service.c +++ b/avahi-core/resolve-service.c @@ -200,10 +200,11 @@ static void record_browser_callback(AvahiSRecordBrowser*rr, AvahiIfIndex interfa } else { assert(event == AVAHI_BROWSER_REMOVE); + switch (record->key->type) { case AVAHI_DNS_TYPE_SRV: - if (avahi_record_equal_no_ttl(record, r->srv_record)) { + if (r->srv_record && avahi_record_equal_no_ttl(record, r->srv_record)) { avahi_record_unref(r->srv_record); r->srv_record = NULL; @@ -216,7 +217,7 @@ static void record_browser_callback(AvahiSRecordBrowser*rr, AvahiIfIndex interfa case AVAHI_DNS_TYPE_TXT: - if (avahi_record_equal_no_ttl(record, r->txt_record)) { + if (r->txt_record && avahi_record_equal_no_ttl(record, r->txt_record)) { avahi_record_unref(r->txt_record); r->txt_record = NULL; @@ -229,7 +230,7 @@ static void record_browser_callback(AvahiSRecordBrowser*rr, AvahiIfIndex interfa case AVAHI_DNS_TYPE_A: case AVAHI_DNS_TYPE_AAAA: - if (avahi_record_equal_no_ttl(record, r->address_record)) { + if (r->address_record && avahi_record_equal_no_ttl(record, r->address_record)) { avahi_record_unref(r->address_record); r->address_record = NULL; -- 2.39.5