svn commit: trunk/busybox/networking

vda at busybox.net vda at busybox.net
Thu Sep 27 11:15:43 UTC 2007


Author: vda
Date: 2007-09-27 04:15:42 -0700 (Thu, 27 Sep 2007)
New Revision: 20065

Log:
zcip: fix unaligned trap on ARM



Modified:
   trunk/busybox/networking/zcip.c


Changeset:
Modified: trunk/busybox/networking/zcip.c
===================================================================
--- trunk/busybox/networking/zcip.c	2007-09-27 10:26:59 UTC (rev 20064)
+++ trunk/busybox/networking/zcip.c	2007-09-27 11:15:42 UTC (rev 20065)
@@ -160,7 +160,8 @@
 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 @@
 	// 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*)&eth_addr);
 	if (ip.s_addr == 0)
 		pick(&ip);
 




More information about the busybox-cvs mailing list