diff options
Diffstat (limited to 'networking/dnsd.c')
-rw-r--r-- | networking/dnsd.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c index 56ede3fca..1a4ccb911 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 dns_prop { | 52 | struct dns_prop { |
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; |
@@ -459,7 +464,8 @@ int dnsd_main(int argc UNUSED_PARAM, char **argv) | |||
459 | unsigned lsa_size; | 464 | unsigned lsa_size; |
460 | int udps, opts; | 465 | int udps, opts; |
461 | uint16_t port = 53; | 466 | uint16_t port = 53; |
462 | uint8_t buf[MAX_PACK_LEN + 1]; | 467 | /* Ensure buf is 32bit aligned (we need 16bit, but 32bit can't hurt) */ |
468 | uint8_t buf[MAX_PACK_LEN + 1] ALIGN4; | ||
463 | 469 | ||
464 | opts = getopt32(argv, "vi:c:t:p:d", &listen_interface, &fileconf, &sttl, &sport); | 470 | opts = getopt32(argv, "vi:c:t:p:d", &listen_interface, &fileconf, &sttl, &sport); |
465 | //if (opts & 0x1) // -v | 471 | //if (opts & 0x1) // -v |