Problem with zcip's packing of ARP packets?
Andre
armcc2000 at yahoo.com
Fri Aug 25 04:55:08 UTC 2006
--- Jason Schoon <floydpink at gmail.com> wrote:
>
> I have seen this problem as well, and submitted a patch to the list
> some time ago. I don't believe it ever got applied though.
> Here it is again.
Patch looks good except for this:
> + /* This cast is safe because ip is always kept as BE */
> + if ((*(unsigned long *)p.arp.arp_spa == ip.s_addr)
The cast is NOT safe (but not for the reason you mention... ;-).
p is a packed structure, therefore arp_spa is not necessarily 32bit
aligned... which means it can't be accessed via an unsigned long
pointer on architectures which care about alignment...
memcmp() would be better.
Same issue is repeated again futher down the patch.
Andre
--
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the busybox
mailing list