[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
??: PR 1098: "struct ipovly" not packed.
- Date: Wed, 12 Jul 2006 08:19:59 -0500
- From: jtm at smoothsmoothie.com (Jay Monkman)
- Subject: ??: PR 1098: "struct ipovly" not packed.
ray wrote:
> The trouble is, we put the Ethernet header??TCP/IP head together into the mbuf, the Ethernet head's length is 14 byte.
> So, when we init ti(in tcp_input/udp_input) with
> ti = mtod(m, struct tcpiphdr *);
> the start address of ti is not 32bit align. then the first member ti->ti_next's address is not 32bit align.
Right. That's why you need to offset the ethernet header - so the IP header is
aligned. One way to do that is, after calling MGETHDR() and MCLGET(), do this:
m->m_data +=2;
Then copy the packet into the mbuf.