Module Name:    src
Committed By:   maxv
Date:           Tue Apr 10 08:22:35 UTC 2018

Modified Files:
        src/sys/netinet: igmp.c

Log Message:
Replace comment by KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/netinet/igmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/igmp.c
diff -u src/sys/netinet/igmp.c:1.66 src/sys/netinet/igmp.c:1.67
--- src/sys/netinet/igmp.c:1.66	Wed Feb  7 11:42:58 2018
+++ src/sys/netinet/igmp.c	Tue Apr 10 08:22:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: igmp.c,v 1.66 2018/02/07 11:42:58 maxv Exp $	*/
+/*	$NetBSD: igmp.c,v 1.67 2018/04/10 08:22:35 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: igmp.c,v 1.66 2018/02/07 11:42:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igmp.c,v 1.67 2018/04/10 08:22:35 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -602,11 +602,8 @@ igmp_sendpkt(struct in_multi *inm, int t
 	MGETHDR(m, M_DONTWAIT, MT_HEADER);
 	if (m == NULL)
 		return;
+	KASSERT(max_linkhdr + sizeof(struct ip) + IGMP_MINLEN <= MHLEN);
 
-	/*
-	 * Assume max_linkhdr + sizeof(struct ip) + IGMP_MINLEN
-	 * is smaller than mbuf size returned by MGETHDR.
-	 */
 	m->m_data += max_linkhdr;
 	m->m_len = sizeof(struct ip) + IGMP_MINLEN;
 	m->m_pkthdr.len = sizeof(struct ip) + IGMP_MINLEN;

Reply via email to