diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-08-22 01:32:48 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-08-22 01:32:48 +0000 |
commit | 2989f4181e7709db305f59b9f47870562880f9f8 (patch) | |
tree | 2a467b2ee9b24d34fbc5b0345f76569ce9214cc2 /sys/netinet | |
parent | ac18cb2a92b9d0c51898851fdb1bcf2228a8e3d2 (diff) | |
download | FreeBSD-src-2989f4181e7709db305f59b9f47870562880f9f8.zip FreeBSD-src-2989f4181e7709db305f59b9f47870562880f9f8.tar.gz |
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
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 81ab6e1..39d1634 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -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 |