Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Replace comment by KASSERT.



details:   https://anonhg.NetBSD.org/src/rev/43c6cb3917af
branches:  trunk
changeset: 831694:43c6cb3917af
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Apr 10 08:22:35 2018 +0000

description:
Replace comment by KASSERT.

diffstat:

 sys/netinet/igmp.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r 304a3b72a89b -r 43c6cb3917af sys/netinet/igmp.c
--- a/sys/netinet/igmp.c        Tue Apr 10 08:18:38 2018 +0000
+++ b/sys/netinet/igmp.c        Tue Apr 10 08:22:35 2018 +0000
@@ -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 @@
        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;



Home | Main Index | Thread Index | Old Index