[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned acce

From: Curt McDowell
Subject: RE: [lwip-users] [PATCH] fix warning for gcc and possible unaligned access
Date: Fri, 21 Apr 2006 17:07:43 -0700

Pedro Alves wrote
> Seems like the right thing to do.
> If the packing is removed from struct ip_addr, and struct 
> ip_addr2 is removed, then there is no need to memcpy anymore.
> A simple:
> sipaddr = hdr->sipaddr;
> will do.

memcpy may still be needed because hdr->sipaddr is misaligned at +2 due to the
format of the ARP packet.  My theory is that struct ip_addr2 was originally
invented because the 4-byte struct/uint32 copy was crashing on someone's 2-byte
aligned CPU!

Curt McDowell
Broadcom Corp.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]