diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-26 14:25:33 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-26 14:25:33 +0200 |
| commit | 6646de02148cecdc1b97a999b10eaa930d9cfca5 (patch) | |
| tree | c8c5b2c3884b19c5807ded1339e3652f0b386fbb | |
| parent | 3963d943f8a9b4ef89f000b5e1424e63dba920f5 (diff) | |
| download | busybox-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.c | 11 |
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: */ | ||
| 47 | struct type_and_class { | 52 | struct 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 */ |
| 52 | struct dns_entry { | 57 | struct dns_entry { |
| 53 | struct dns_entry *next; | 58 | struct dns_entry *next; |
