aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-09-27 11:15:42 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-09-27 11:15:42 +0000
commit6124c37135b2766d785471fe9b3eba9c1a233c66 (patch)
tree3602d390df6e4ac7fe14d613d45a3229700b476f
parent7c654ae9df92bc8dd4fcbf7aba47e5f49ea2dd54 (diff)
downloadbusybox-w32-6124c37135b2766d785471fe9b3eba9c1a233c66.tar.gz
busybox-w32-6124c37135b2766d785471fe9b3eba9c1a233c66.tar.bz2
busybox-w32-6124c37135b2766d785471fe9b3eba9c1a233c66.zip
zcip: fix unaligned trap on ARM
-rw-r--r--networking/zcip.c5
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);
160int zcip_main(int argc, char **argv) 160int zcip_main(int argc, char **argv)
161{ 161{
162 int state = PROBE; 162 int state = PROBE;
163 struct ether_addr eth_addr; 163 /* Prevent unaligned traps for ARM (see srand() below) */
164 struct ether_addr eth_addr __attribute__(( aligned(sizeof(unsigned)) ));
164 const char *why; 165 const char *why;
165 int fd; 166 int fd;
166 char *r_opt; 167 char *r_opt;
@@ -252,7 +253,7 @@ int zcip_main(int argc, char **argv)
252 // the hardware address or else the last address we used. 253 // the hardware address or else the last address we used.
253 // NOTE: the sequence of addresses we try changes only 254 // NOTE: the sequence of addresses we try changes only
254 // depending on when we detect conflicts. 255 // depending on when we detect conflicts.
255 srand(*(unsigned*)&ifr.ifr_hwaddr.sa_data); 256 srand(*(unsigned*)&eth_addr);
256 if (ip.s_addr == 0) 257 if (ip.s_addr == 0)
257 pick(&ip); 258 pick(&ip);
258 259