[Pkg-utopia-commits] r1399 - in packages/unstable/avahi/debian: .
patches
Sjoerd Simons
sjoerd at alioth.debian.org
Sat Apr 14 11:38:08 UTC 2007
Author: sjoerd
Date: 2007-04-14 11:38:08 +0000 (Sat, 14 Apr 2007)
New Revision: 1399
Modified:
packages/unstable/avahi/debian/changelog
packages/unstable/avahi/debian/patches/13_avahi_big_dns_records.patch
Log:
* debian/patches/13_avahi_big_dns_records.patch
+ Update this patch to the version that was commited upstream
Modified: packages/unstable/avahi/debian/changelog
===================================================================
--- packages/unstable/avahi/debian/changelog 2007-04-14 09:03:53 UTC (rev 1398)
+++ packages/unstable/avahi/debian/changelog 2007-04-14 11:38:08 UTC (rev 1399)
@@ -1,3 +1,10 @@
+avahi (0.6.17-4) UNRELEASED; urgency=low
+
+ * debian/patches/13_avahi_big_dns_records.patch
+ + Update this patch to the version that was commited upstream
+
+ -- Sjoerd Simons <sjoerd at debian.org> Sat, 14 Apr 2007 11:14:58 +0200
+
avahi (0.6.17-3) unstable; urgency=low
* Upload to unstable
Modified: packages/unstable/avahi/debian/patches/13_avahi_big_dns_records.patch
===================================================================
--- packages/unstable/avahi/debian/patches/13_avahi_big_dns_records.patch 2007-04-14 09:03:53 UTC (rev 1398)
+++ packages/unstable/avahi/debian/patches/13_avahi_big_dns_records.patch 2007-04-14 11:38:08 UTC (rev 1399)
@@ -1,21 +1,21 @@
Index: avahi-core/dns.c
===================================================================
---- avahi-core/dns.c (revision 1400)
-+++ avahi-core/dns.c (working copy)
-@@ -786,7 +787,7 @@
+--- avahi-core/dns.c (revision 1404)
++++ avahi-core/dns.c (revision 1405)
+@@ -786,7 +786,7 @@
goto fail;
size = avahi_dns_packet_extend(p, 0) - start;
- assert(size <= 0xFFFF);
-+ assert(size <= AVAHI_DNS_MAX_RDATA);
++ assert(size <= AVAHI_DNS_RDATA_MAX);
/* avahi_log_debug("appended %u", size); */
Index: avahi-core/dns.h
===================================================================
---- avahi-core/dns.h (revision 1400)
-+++ avahi-core/dns.h (working copy)
-@@ -25,10 +25,12 @@
+--- avahi-core/dns.h (revision 1404)
++++ avahi-core/dns.h (revision 1405)
+@@ -25,10 +25,11 @@
#include "rr.h"
#include "hashmap.h"
@@ -23,65 +23,98 @@
#define AVAHI_DNS_PACKET_HEADER_SIZE 12
#define AVAHI_DNS_PACKET_EXTRA_SIZE 48
#define AVAHI_DNS_LABELS_MAX 127
-+#define AVAHI_DNS_MAX_RDATA 0xFFFF
-+#define AVAHI_DNS_PACKET_SIZE_MAX \
-+ AVAHI_DNS_MAX_RDATA + AVAHI_DNS_PACKET_HEADER_SIZE + AVAHI_DNS_LABELS_MAX
++#define AVAHI_DNS_RDATA_MAX 0xFFFF
++#define AVAHI_DNS_PACKET_SIZE_MAX (AVAHI_DNS_PACKET_HEADER_SIZE + 256 + 2 + 2 + 4 + 2 + AVAHI_DNS_RDATA_MAX)
typedef struct AvahiDnsPacket {
size_t size, rindex, max_size;
+@@ -106,7 +107,5 @@
+ #define AVAHI_MDNS_SUFFIX_ADDR_IPV4 "254.169.in-addr.arpa"
+ #define AVAHI_MDNS_SUFFIX_ADDR_IPV6 "0.8.e.f.ip6.arpa"
+
+-#define AVAHI_DNS_RDATA_MAX 65535
+-
+ #endif
+
Index: avahi-core/response-sched.c
===================================================================
---- avahi-core/response-sched.c (revision 1400)
-+++ avahi-core/response-sched.c (working copy)
-@@ -245,11 +245,9 @@
- avahi_dns_packet_free(p);
-
+--- avahi-core/response-sched.c (revision 1404)
++++ avahi-core/response-sched.c (revision 1405)
+@@ -247,10 +247,7 @@
/* OK, the packet was too small, so create one that fits */
-- size = avahi_record_get_estimate_size(rj->record) + AVAHI_DNS_PACKET_HEADER_SIZE;
-+ size = avahi_record_get_estimate_size(rj->record)
-+ + AVAHI_DNS_PACKET_HEADER_SIZE + AVAHI_DNS_PACKET_EXTRA_SIZE;
+ size = avahi_record_get_estimate_size(rj->record) + AVAHI_DNS_PACKET_HEADER_SIZE;
- if (size > AVAHI_DNS_PACKET_SIZE_MAX)
- size = AVAHI_DNS_PACKET_SIZE_MAX;
-
- if (!(p = avahi_dns_packet_new_response(size, 1)))
+- if (!(p = avahi_dns_packet_new_response(size, 1)))
++ if (!(p = avahi_dns_packet_new_response(size + AVAHI_DNS_PACKET_EXTRA_SIZE, 1)))
return; /* OOM */
+ if (!packet_add_response_job(s, p, rj)) {
Index: avahi-core/probe-sched.c
===================================================================
---- avahi-core/probe-sched.c (revision 1400)
-+++ avahi-core/probe-sched.c (working copy)
-@@ -248,10 +248,7 @@
- size =
- avahi_key_get_estimate_size(pj->record->key) +
+--- avahi-core/probe-sched.c (revision 1404)
++++ avahi-core/probe-sched.c (revision 1405)
+@@ -250,10 +250,7 @@
avahi_record_get_estimate_size(pj->record) +
-- AVAHI_DNS_PACKET_HEADER_SIZE;
--
+ AVAHI_DNS_PACKET_HEADER_SIZE;
+
- if (size > AVAHI_DNS_PACKET_SIZE_MAX)
- size = AVAHI_DNS_PACKET_SIZE_MAX;
-+ AVAHI_DNS_PACKET_HEADER_SIZE + AVAHI_DNS_PACKET_EXTRA_SIZE;
+-
+- if (!(p = avahi_dns_packet_new_query(size)))
++ if (!(p = avahi_dns_packet_new_query(size + AVAHI_DNS_PACKET_EXTRA_SIZE)))
+ return; /* OOM */
- if (!(p = avahi_dns_packet_new_query(size)))
- return; /* OOM */
+ if (!(k = avahi_key_new(pj->record->key->name, pj->record->key->clazz, AVAHI_DNS_TYPE_ANY))) {
Index: avahi-core/server.c
===================================================================
---- avahi-core/server.c (revision 1400)
-+++ avahi-core/server.c (working copy)
-@@ -448,9 +448,9 @@
- /* The record is too large for one packet, so create a larger packet */
+--- avahi-core/server.c (revision 1404)
++++ avahi-core/server.c (revision 1405)
+@@ -370,7 +370,7 @@
+ AvahiDnsPacket *reply;
+ AvahiRecord *r;
+- if (!(reply = avahi_dns_packet_new_reply(p, 512 /* unicast DNS maximum packet size is 512 */ , 1, 1)))
++ if (!(reply = avahi_dns_packet_new_reply(p, 512 + AVAHI_DNS_PACKET_EXTRA_SIZE /* unicast DNS maximum packet size is 512 */ , 1, 1)))
+ return; /* OOM */
+
+ while ((r = avahi_record_list_next(s->record_list, NULL, NULL, NULL))) {
+@@ -438,7 +438,6 @@
+ * the specific header field, and return to the caller */
+
+ avahi_dns_packet_inc_field(reply, AVAHI_DNS_FIELD_ANCOUNT);
+-
+ break;
+ }
+
+@@ -449,21 +448,32 @@
+
avahi_dns_packet_free(reply);
-- size = avahi_record_get_estimate_size(r) + AVAHI_DNS_PACKET_HEADER_SIZE;
+ size = avahi_record_get_estimate_size(r) + AVAHI_DNS_PACKET_HEADER_SIZE;
- if (size > AVAHI_DNS_PACKET_SIZE_MAX)
- size = AVAHI_DNS_PACKET_SIZE_MAX;
-+ size = avahi_record_get_estimate_size(r)
-+ + AVAHI_DNS_PACKET_HEADER_SIZE
-+ + AVAHI_DNS_PACKET_EXTRA_SIZE;
- if (!(reply = avahi_dns_packet_new_reply(p, size, 0, 1)))
+- if (!(reply = avahi_dns_packet_new_reply(p, size, 0, 1)))
++ if (!(reply = avahi_dns_packet_new_reply(p, size + AVAHI_DNS_PACKET_EXTRA_SIZE, 0, 1)))
break; /* OOM */
-@@ -458,12 +458,19 @@
- if (!avahi_dns_packet_append_record(reply, r, flush_cache, 0)) {
+
+- if (!avahi_dns_packet_append_record(reply, r, flush_cache, 0)) {
++ if (avahi_dns_packet_append_record(reply, r, flush_cache, 0)) {
++
++ /* Appending this record succeeded, so incremeant
++ * the specific header field, and return to the caller */
++
++ avahi_dns_packet_inc_field(reply, AVAHI_DNS_FIELD_ANCOUNT);
++ break;
++
++ } else {
++
++ /* We completely fucked up, there's
++ * nothing we can do. The RR just doesn't
++ * fit in. Let's ignore it. */
++
char *t;
avahi_dns_packet_free(reply);
+ reply = NULL;
@@ -91,14 +124,7 @@
break;
- } else
- avahi_dns_packet_inc_field(reply, AVAHI_DNS_FIELD_ANCOUNT);
-+ }
-+ /* Packet specifically made so this record fits.. no
-+ * more records can be added so sent it out */
-+ avahi_dns_packet_inc_field(reply, AVAHI_DNS_FIELD_ANCOUNT);
-+ avahi_interface_send_packet_unicast(i, reply, a, port);
-+ avahi_dns_packet_free(reply);
-+ reply = NULL;
-+ break;
++ }
}
/* Appending the record didn't succeeed, so let's send this packet, and create a new one */
More information about the Pkg-utopia-commits
mailing list