summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-02-02 14:27:13 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-02-13 10:34:19 +0100
commit7eeb079d84bc4abe9897be0047fc28a754e46ecd (patch)
tree9b47ac7055ce0cb1e2d86c684a2a7a1cd20c0c4d /freebsd/sys/netinet/ip_output.c
parentfreebsd-to-rtems.py: Fix revert includes (diff)
downloadrtems-libbsd-7eeb079d84bc4abe9897be0047fc28a754e46ecd.tar.bz2
Update to FreeBSD 9.3
Diffstat (limited to 'freebsd/sys/netinet/ip_output.c')
-rw-r--r--freebsd/sys/netinet/ip_output.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/freebsd/sys/netinet/ip_output.c b/freebsd/sys/netinet/ip_output.c
index a70d3142..93ebf4d6 100644
--- a/freebsd/sys/netinet/ip_output.c
+++ b/freebsd/sys/netinet/ip_output.c
@@ -869,17 +869,13 @@ in_delayed_cksum(struct mbuf *m)
csum = 0xffff;
offset += m->m_pkthdr.csum_data; /* checksum offset */
- if (offset + sizeof(u_short) > m->m_len) {
- printf("delayed m_pullup, m->len: %d off: %d p: %d\n",
- m->m_len, offset, ip->ip_p);
- /*
- * XXX
- * this shouldn't happen, but if it does, the
- * correct behavior may be to insert the checksum
- * in the appropriate next mbuf in the chain.
- */
- return;
+ /* find the mbuf in the chain where the checksum starts*/
+ while ((m != NULL) && (offset >= m->m_len)) {
+ offset -= m->m_len;
+ m = m->m_next;
}
+ KASSERT(m != NULL, ("in_delayed_cksum: checksum outside mbuf chain."));
+ KASSERT(offset + sizeof(u_short) <= m->m_len, ("in_delayed_cksum: checksum split between mbufs."));
*(u_short *)(m->m_data + offset) = csum;
}