diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-27 11:15:42 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-27 11:15:42 +0000 |
commit | 6124c37135b2766d785471fe9b3eba9c1a233c66 (patch) | |
tree | 3602d390df6e4ac7fe14d613d45a3229700b476f | |
parent | 7c654ae9df92bc8dd4fcbf7aba47e5f49ea2dd54 (diff) | |
download | busybox-6124c37135b2766d785471fe9b3eba9c1a233c66.tar.gz |
zcip: fix unaligned trap on ARM
-rw-r--r-- | networking/zcip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/networking/zcip.c b/networking/zcip.c index 63846ebef..62350c640 100644 --- a/networking/zcip.c +++ b/networking/zcip.c @@ -160,7 +160,8 @@ int zcip_main(int argc, char **argv); int zcip_main(int argc, char **argv) { int state = PROBE; - struct ether_addr eth_addr; + /* Prevent unaligned traps for ARM (see srand() below) */ + struct ether_addr eth_addr __attribute__(( aligned(sizeof(unsigned)) )); const char *why; int fd; char *r_opt; @@ -252,7 +253,7 @@ int zcip_main(int argc, char **argv) // the hardware address or else the last address we used. // NOTE: the sequence of addresses we try changes only // depending on when we detect conflicts. - srand(*(unsigned*)&ifr.ifr_hwaddr.sa_data); + srand(*(unsigned*)ð_addr); if (ip.s_addr == 0) pick(&ip); |