Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 May 2014 20:47:55 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265713 - head/sys/netinet
Message-ID:  <201405082047.s48Klt8V031593@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405082047.s48Klt8V031593>