[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PR 1098: "struct ipovly" notpacked.
- Date: Tue, 11 Jul 2006 12:43:18 -0500
- From: jtm at smoothsmoothie.com (Jay Monkman)
- Subject: PR 1098: "struct ipovly" notpacked.
ray wrote:
> In fact, the PR works for the ARM board.
> And the __attribute__((packed)) do really convert the 32bit load/store instruction to 2 16bit load/store instruction(or 4 8bit load/store).
> The struct may seems well format, but after packing and copying, the head point of tcpiphdr is not 32bit aligned, which may cause data access abort. And in the new version of BSD, the mal-aligned members (ti_next, ti_prev) have gone.
Are you saying that your tcpiphdr structs are not aligned? They should be. Are
you looking at outgoing or incoming packets?
I suspect you're seeing this for received packets because you are aligning the
ethernet header. In that case, stop it. When you write the received packet into
the buffer, do it so that the start of the IP packet is aligned. That means the
ethernet header will be misaligned, but that's unimportant.