summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/avahi/avahi-0.5.2/alignment-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'openembedded/packages/avahi/avahi-0.5.2/alignment-fix.patch')
-rw-r--r--openembedded/packages/avahi/avahi-0.5.2/alignment-fix.patch96
1 files changed, 0 insertions, 96 deletions
diff --git a/openembedded/packages/avahi/avahi-0.5.2/alignment-fix.patch b/openembedded/packages/avahi/avahi-0.5.2/alignment-fix.patch
deleted file mode 100644
index fc23f23756..0000000000
--- a/openembedded/packages/avahi/avahi-0.5.2/alignment-fix.patch
+++ /dev/null
@@ -1,96 +0,0 @@
1--- avahi-0.5/avahi-core/dns.c.orig 2005-09-23 16:35:02 +0200
2+++ avahi-0.5/avahi-core/dns.c 2005-09-23 16:35:07 +0200
3@@ -177,11 +177,13 @@
4 assert(idx < p->size);
5
6 if (idx < 0x4000) {
7- uint16_t *t;
8- if (!(t = (uint16_t*) avahi_dns_packet_extend(p, sizeof(uint16_t))))
9+ uint8_t *t;
10+
11+ if (!(t = (uint8_t*) avahi_dns_packet_extend(p, sizeof(uint16_t))))
12 return NULL;
13
14- *t = htons((0xC000 | idx));
15+ t[0] = (uint8_t) ((0xC000 | idx) >> 8);
16+ t[1] = (uint8_t) idx;
17 return saved_ptr;
18 }
19 }
20@@ -223,7 +225,8 @@
21 if (!(d = avahi_dns_packet_extend(p, sizeof(uint16_t))))
22 return NULL;
23
24- *((uint16_t*) d) = htons(v);
25+ d[0] = (uint8_t) (v >> 8);
26+ d[1] = (uint8_t) v;
27 return d;
28 }
29
30@@ -234,7 +237,10 @@
31 if (!(d = avahi_dns_packet_extend(p, sizeof(uint32_t))))
32 return NULL;
33
34- *((uint32_t*) d) = htonl(v);
35+ d[0] = (uint8_t) (v >> 24);
36+ d[1] = (uint8_t) (v >> 16);
37+ d[2] = (uint8_t) (v >> 8);
38+ d[3] = (uint8_t) v;
39
40 return d;
41 }
42@@ -385,26 +391,42 @@
43 }
44
45 int avahi_dns_packet_consume_uint16(AvahiDnsPacket *p, uint16_t *ret_v) {
46+ uint8_t *d;
47+ uint16_t tmp_v;
48+
49 assert(p);
50 assert(ret_v);
51
52 if (p->rindex + sizeof(uint16_t) > p->size)
53 return -1;
54
55- *ret_v = ntohs(*((uint16_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex)));
56+ d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex);
57+ tmp_v = (d[0] << 8) | d[1];
58+ d = (uint8_t*) ret_v;
59+ d[0] = ((uint8_t*)(&tmp_v))[0];
60+ d[1] = ((uint8_t*)(&tmp_v))[1];
61 p->rindex += sizeof(uint16_t);
62
63 return 0;
64 }
65
66 int avahi_dns_packet_consume_uint32(AvahiDnsPacket *p, uint32_t *ret_v) {
67+ uint8_t* d;
68+ uint32_t tmp_v;
69+
70 assert(p);
71 assert(ret_v);
72
73 if (p->rindex + sizeof(uint32_t) > p->size)
74 return -1;
75
76- *ret_v = ntohl(*((uint32_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex)));
77+ d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex);
78+ tmp_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
79+ d = (uint8_t*) ret_v;
80+ d[0] = ((uint8_t*)(&tmp_v))[0];
81+ d[1] = ((uint8_t*)(&tmp_v))[1];
82+ d[2] = ((uint8_t*)(&tmp_v))[2];
83+ d[3] = ((uint8_t*)(&tmp_v))[3];
84 p->rindex += sizeof(uint32_t);
85
86 return 0;
87@@ -733,7 +755,8 @@
88
89 /* avahi_log_debug("appended %u", size); */
90
91- * (uint16_t*) l = htons((uint16_t) size);
92+ l[0] = (uint8_t) ((uint16_t) size >> 8);
93+ l[1] = (uint8_t) ((uint16_t) size);
94
95 return t;
96