Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 Fix the KASSERTs. It doesn't matter at all sinc...



details:   https://anonhg.NetBSD.org/src/rev/b475e9b284e3
branches:  trunk
changeset: 322782:b475e9b284e3
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu May 17 12:07:48 2018 +0000

description:
Fix the KASSERTs. It doesn't matter at all since the packet can't be this
big anyway, and there are many other places that have this kind of typo;
but still fix it, for the sake of closing PR/49834.

diffstat:

 sys/netinet6/nd6_nbr.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 7a6b0d83360b -r b475e9b284e3 sys/netinet6/nd6_nbr.c
--- a/sys/netinet6/nd6_nbr.c    Thu May 17 11:59:36 2018 +0000
+++ b/sys/netinet6/nd6_nbr.c    Thu May 17 12:07:48 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6_nbr.c,v 1.154 2018/05/01 07:21:39 maxv Exp $       */
+/*     $NetBSD: nd6_nbr.c,v 1.155 2018/05/17 12:07:48 maxv Exp $       */
 /*     $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $        */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.154 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.155 2018/05/17 12:07:48 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -392,8 +392,8 @@
        /* estimate the size of message */
        maxlen = sizeof(*ip6) + sizeof(*nd_ns);
        maxlen += (sizeof(struct nd_opt_hdr) + ifp->if_addrlen + 7) & ~7;
-       KASSERTMSG(max_linkhdr + maxlen < MCLBYTES,
-           "max_linkhdr + maxlen >= MCLBYTES (%d + %d >= %d)",
+       KASSERTMSG(max_linkhdr + maxlen <= MCLBYTES,
+           "max_linkhdr + maxlen > MCLBYTES (%d + %d > %d)",
            max_linkhdr, maxlen, MCLBYTES);
 
        MGETHDR(m, M_DONTWAIT, MT_DATA);
@@ -922,8 +922,8 @@
        /* estimate the size of message */
        maxlen = sizeof(*ip6) + sizeof(*nd_na);
        maxlen += (sizeof(struct nd_opt_hdr) + ifp->if_addrlen + 7) & ~7;
-       KASSERTMSG(max_linkhdr + maxlen < MCLBYTES,
-           "max_linkhdr + maxlen >= MCLBYTES (%d + %d >= %d)",
+       KASSERTMSG(max_linkhdr + maxlen <= MCLBYTES,
+           "max_linkhdr + maxlen > MCLBYTES (%d + %d > %d)",
            max_linkhdr, maxlen, MCLBYTES);
 
        MGETHDR(m, M_DONTWAIT, MT_DATA);



Home | Main Index | Thread Index | Old Index