When sliding the m_data pointer forward, update m_pktrhdr.len as well

as m_len, or the pkthdr length will be inconsistent with the actual
length of data in the mbuf chain.  The symptom of this occuring was
"out of data" warnings from in_cksum_skip() on large UDP packets sent
via the loopback interface.

Foot shot:	green
This commit is contained in:
Robert Watson 2004-08-22 01:32:48 +00:00
parent dc2492d303
commit 392e840716
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134142

View File

@ -854,7 +854,8 @@ udp_output(inp, m, addr, control, td)
/*
* Calculate data length and get a mbuf for UDP, IP, and possible
* link-layer headers.
* link-layer headers. Immediate slide the data pointer back forward
* since we won't use that space at this layer.
*/
M_PREPEND(m, sizeof(struct udpiphdr) + max_linkhdr, M_DONTWAIT);
if (m == NULL) {
@ -863,6 +864,7 @@ udp_output(inp, m, addr, control, td)
}
m->m_data += max_linkhdr;
m->m_len -= max_linkhdr;
m->m_pkthdr.len -= max_linkhdr;
/*
* Fill in mbuf with extended UDP header