svn commit: r265713 - head/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Thu May 8 20:47:55 UTC 2014
Author: tuexen
Date: Thu May 8 20:47:54 2014
New Revision: 265713
URL: http://svnweb.freebsd.org/changeset/base/265713
Log:
Use KASSERTs as suggested by glebius@
MFC after: 3 days
X-MFC with: 265691
Modified:
head/sys/netinet/ip_output.c
Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c Thu May 8 20:46:46 2014 (r265712)
+++ head/sys/netinet/ip_output.c Thu May 8 20:47:54 2014 (r265713)
@@ -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;
}
More information about the svn-src-head
mailing list