Use KASSERTs as suggested by glebius@

MFC after: 3 days
X-MFC with: 265691
This commit is contained in:
Michael Tuexen 2014-05-08 20:47:54 +00:00
parent a371d6f964
commit 26461454fc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=265713

View file

@ -892,20 +892,8 @@ in_delayed_cksum(struct mbuf *m)
offset -= m->m_len;
m = m->m_next;
}
if (m == NULL) {
/* This should not happen. */
printf("in_delayed_cksum(): checksum outside mbuf chain.\n");
return;
}
if (offset + sizeof(u_short) > m->m_len) {
/*
* XXX
* This should not happen, but if it does, it might make more
* sense to fix the caller than to add code to split it here.
*/
printf("in_delayed_cksum(): checksum split between mbufs.\n");
return;
}
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;
}