From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:47:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D924180; Thu, 8 May 2014 20:47:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B3281AC; Thu, 8 May 2014 20:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48Kltxp031595; Thu, 8 May 2014 20:47:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Klt8V031593; Thu, 8 May 2014 20:47:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405082047.s48Klt8V031593@svn.freebsd.org> From: Michael Tuexen Date: Thu, 8 May 2014 20:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265713 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:47:55 -0000 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; }