add to patches to fix RR updating

This commit is contained in:
Lennart Poettering 2007-07-11 17:22:22 +00:00
parent f4753f9712
commit 757d3919ee
3 changed files with 90 additions and 1 deletions

View File

@ -0,0 +1,64 @@
Index: avahi-core/dns.c
===================================================================
--- avahi-core/dns.c (revision 1492)
+++ avahi-core/dns.c (revision 1497)
@@ -153,6 +153,19 @@
avahi_dns_packet_set_field(p, idx, avahi_dns_packet_get_field(p, idx) + 1);
}
+
+static void name_table_cleanup(void *key, void *value, void *user_data) {
+ AvahiDnsPacket *p = user_data;
+
+ if ((uint8_t*) value >= AVAHI_DNS_PACKET_DATA(p) + p->size)
+ avahi_hashmap_remove(p->name_table, key);
+}
+
+void avahi_dns_packet_cleanup_name_table(AvahiDnsPacket *p) {
+ if (p->name_table)
+ avahi_hashmap_foreach(p->name_table, name_table_cleanup, p);
+}
+
uint8_t* avahi_dns_packet_append_name(AvahiDnsPacket *p, const char *name) {
uint8_t *d, *saved_ptr = NULL;
size_t saved_size;
@@ -216,6 +229,8 @@
fail:
p->size = saved_size;
+ avahi_dns_packet_cleanup_name_table(p);
+
return NULL;
}
@@ -685,6 +700,8 @@
!avahi_dns_packet_append_uint16(p, k->type) ||
!avahi_dns_packet_append_uint16(p, k->clazz | (unicast_response ? AVAHI_DNS_UNICAST_RESPONSE : 0))) {
p->size = size;
+ avahi_dns_packet_cleanup_name_table(p);
+
return NULL;
}
@@ -799,6 +816,8 @@
fail:
p->size = size;
+ avahi_dns_packet_cleanup_name_table(p);
+
return NULL;
}
Index: avahi-core/dns.h
===================================================================
--- avahi-core/dns.h (revision 1492)
+++ avahi-core/dns.h (revision 1497)
@@ -52,6 +52,8 @@
uint8_t *avahi_dns_packet_extend(AvahiDnsPacket *p, size_t l);
+void avahi_dns_packet_cleanup_name_table(AvahiDnsPacket *p);
+
uint8_t *avahi_dns_packet_append_uint16(AvahiDnsPacket *p, uint16_t v);
uint8_t *avahi_dns_packet_append_uint32(AvahiDnsPacket *p, uint32_t v);
uint8_t *avahi_dns_packet_append_name(AvahiDnsPacket *p, const char *name);

View File

@ -0,0 +1,17 @@
Index: /trunk/avahi-core/server.c
===================================================================
--- /trunk/avahi-core/server.c (revision 1463)
+++ /trunk/avahi-core/server.c (revision 1496)
@@ -611,9 +611,7 @@
}
- if (handle_conflict(s, i, record, unique)) {
- avahi_response_scheduler_suppress(i->response_scheduler, record, a);
- avahi_record_list_drop(s->record_list, record);
- avahi_cache_stop_poof(i->cache, record, a);
- }
+ avahi_response_scheduler_suppress(i->response_scheduler, record, a);
+ avahi_record_list_drop(s->record_list, record);
+ avahi_cache_stop_poof(i->cache, record, a);
avahi_record_unref(record);

View File

@ -6,7 +6,7 @@
%endif
Name: avahi
Version: 0.6.20
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Local network service discovery
Group: System Environment/Base
License: LGPL
@ -36,6 +36,8 @@ BuildRequires: mono-devel >= 1.1.13
Obsoletes: howl
Source0: http://avahi.org/download/%{name}-%{version}.tar.gz
# enable mono's mcs to work in beehive buildroot:
Patch0: avahi-0.6.20-cleanup-dns-compression-table.patch
Patch1: avahi-0.6.20-make-known-answers-not-conflict.patch
Patch6: avahi-0.6.3-MONO_SHARED_DIR.patch
%description
@ -207,6 +209,8 @@ fashion with mDNS.
%prep
%setup -q
%if %{WITH_MONO}
%patch0 -p0 -b .cleanup-dns-compression-table
%patch1 -p2 -b .make-known-answers-not-conflict
%patch6 -p1 -b .MONO_SHARED_DIR
%endif
@ -462,6 +466,10 @@ fi
%endif
%changelog
* Wed Jul 11 2007 Lennart Poettering <lpoetter@redhat.com> - 0.6.20-5
- add two patches which are important to get RR updating work properly.
Will be part of upstream 0.6.21
* Thu Jul 5 2007 Dan Williams <dcbw@redhat.com> - 0.6.20-4
- Add Requires(pre): shadow-utils for avahi-autoipd package