??: PR 1098: "struct ipovly" not packed.

Jay Monkman jtm at smoothsmoothie.com
Wed Jul 12 13:19:59 UTC 2006

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.

More information about the users mailing list