From d153ad53bd1a263654e71b8bd7d738cfee5408b4 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 10 Oct 2005 11:14:51 +0000 Subject: Add OE version of avahi (0.5.1) git-svn-id: https://svn.o-hand.com/repos/poky@128 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- .../packages/avahi/avahi-0.5.1/alignment-fix.patch | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 openembedded/packages/avahi/avahi-0.5.1/alignment-fix.patch (limited to 'openembedded/packages/avahi/avahi-0.5.1') diff --git a/openembedded/packages/avahi/avahi-0.5.1/alignment-fix.patch b/openembedded/packages/avahi/avahi-0.5.1/alignment-fix.patch new file mode 100644 index 000000000..fc23f2375 --- /dev/null +++ b/openembedded/packages/avahi/avahi-0.5.1/alignment-fix.patch @@ -0,0 +1,96 @@ +--- avahi-0.5/avahi-core/dns.c.orig 2005-09-23 16:35:02 +0200 ++++ avahi-0.5/avahi-core/dns.c 2005-09-23 16:35:07 +0200 +@@ -177,11 +177,13 @@ + assert(idx < p->size); + + if (idx < 0x4000) { +- uint16_t *t; +- if (!(t = (uint16_t*) avahi_dns_packet_extend(p, sizeof(uint16_t)))) ++ uint8_t *t; ++ ++ if (!(t = (uint8_t*) avahi_dns_packet_extend(p, sizeof(uint16_t)))) + return NULL; + +- *t = htons((0xC000 | idx)); ++ t[0] = (uint8_t) ((0xC000 | idx) >> 8); ++ t[1] = (uint8_t) idx; + return saved_ptr; + } + } +@@ -223,7 +225,8 @@ + if (!(d = avahi_dns_packet_extend(p, sizeof(uint16_t)))) + return NULL; + +- *((uint16_t*) d) = htons(v); ++ d[0] = (uint8_t) (v >> 8); ++ d[1] = (uint8_t) v; + return d; + } + +@@ -234,7 +237,10 @@ + if (!(d = avahi_dns_packet_extend(p, sizeof(uint32_t)))) + return NULL; + +- *((uint32_t*) d) = htonl(v); ++ d[0] = (uint8_t) (v >> 24); ++ d[1] = (uint8_t) (v >> 16); ++ d[2] = (uint8_t) (v >> 8); ++ d[3] = (uint8_t) v; + + return d; + } +@@ -385,26 +391,42 @@ + } + + int avahi_dns_packet_consume_uint16(AvahiDnsPacket *p, uint16_t *ret_v) { ++ uint8_t *d; ++ uint16_t tmp_v; ++ + assert(p); + assert(ret_v); + + if (p->rindex + sizeof(uint16_t) > p->size) + return -1; + +- *ret_v = ntohs(*((uint16_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex))); ++ d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex); ++ tmp_v = (d[0] << 8) | d[1]; ++ d = (uint8_t*) ret_v; ++ d[0] = ((uint8_t*)(&tmp_v))[0]; ++ d[1] = ((uint8_t*)(&tmp_v))[1]; + p->rindex += sizeof(uint16_t); + + return 0; + } + + int avahi_dns_packet_consume_uint32(AvahiDnsPacket *p, uint32_t *ret_v) { ++ uint8_t* d; ++ uint32_t tmp_v; ++ + assert(p); + assert(ret_v); + + if (p->rindex + sizeof(uint32_t) > p->size) + return -1; + +- *ret_v = ntohl(*((uint32_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex))); ++ d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex); ++ tmp_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3]; ++ d = (uint8_t*) ret_v; ++ d[0] = ((uint8_t*)(&tmp_v))[0]; ++ d[1] = ((uint8_t*)(&tmp_v))[1]; ++ d[2] = ((uint8_t*)(&tmp_v))[2]; ++ d[3] = ((uint8_t*)(&tmp_v))[3]; + p->rindex += sizeof(uint32_t); + + return 0; +@@ -733,7 +755,8 @@ + + /* avahi_log_debug("appended %u", size); */ + +- * (uint16_t*) l = htons((uint16_t) size); ++ l[0] = (uint8_t) ((uint16_t) size >> 8); ++ l[1] = (uint8_t) ((uint16_t) size); + + return t; + -- cgit v1.2.3