aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-04-26 14:25:33 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-04-26 14:25:33 +0200
commit6646de02148cecdc1b97a999b10eaa930d9cfca5 (patch)
treec8c5b2c3884b19c5807ded1339e3652f0b386fbb
parent3963d943f8a9b4ef89f000b5e1424e63dba920f5 (diff)
downloadbusybox-w32-6646de02148cecdc1b97a999b10eaa930d9cfca5.tar.gz
busybox-w32-6646de02148cecdc1b97a999b10eaa930d9cfca5.tar.bz2
busybox-w32-6646de02148cecdc1b97a999b10eaa930d9cfca5.zip
dnsd: fix unaligned access problem
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/dnsd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c
index c76a54f9e..1a99040ac 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -44,10 +44,15 @@ struct dns_head {
44 uint16_t nauth; 44 uint16_t nauth;
45 uint16_t nadd; 45 uint16_t nadd;
46}; 46};
47/* Structure used to access type and class fields.
48 * They are totally unaligned, but gcc 4.3.4 thinks that pointer of type uint16_t*
49 * is 16-bit aligned and replaces 16-bit memcpy (in move_from_unaligned16 macro)
50 * with aligned halfword access on arm920t!
51 * Oh well. Slapping PACKED everywhere seems to help: */
47struct type_and_class { 52struct type_and_class {
48 uint16_t type; 53 uint16_t type PACKED;
49 uint16_t class; 54 uint16_t class PACKED;
50}; 55} PACKED;
51/* element of known name, ip address and reversed ip address */ 56/* element of known name, ip address and reversed ip address */
52struct dns_entry { 57struct dns_entry {
53 struct dns_entry *next; 58 struct dns_entry *next;