Source-Changes-HG archive

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

[src/trunk]: src/sys/net/npf nbuf_ensure_contig: fix assert (can be equal if ...



details:   https://anonhg.NetBSD.org/src/rev/80624dfd9adf
branches:  trunk
changeset: 785055:80624dfd9adf
user:      rmind <rmind%NetBSD.org@localhost>
date:      Tue Feb 19 23:57:37 2013 +0000

description:
nbuf_ensure_contig: fix assert (can be equal if there is zero-length mbuf).
Found by npftest on sparc64.

diffstat:

 sys/net/npf/npf_mbuf.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5dfca735ae01 -r 80624dfd9adf sys/net/npf/npf_mbuf.c
--- a/sys/net/npf/npf_mbuf.c    Tue Feb 19 23:29:15 2013 +0000
+++ b/sys/net/npf/npf_mbuf.c    Tue Feb 19 23:57:37 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_mbuf.c,v 1.10 2013/01/20 18:45:56 rmind Exp $      */
+/*     $NetBSD: npf_mbuf.c,v 1.11 2013/02/19 23:57:37 rmind Exp $      */
 
 /*-
  * Copyright (c) 2009-2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_mbuf.c,v 1.10 2013/01/20 18:45:56 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_mbuf.c,v 1.11 2013/02/19 23:57:37 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/mbuf.h>
@@ -163,7 +163,7 @@
        const struct mbuf * const n = nbuf->nb_mbuf;
        const size_t off = (uintptr_t)nbuf->nb_nptr - mtod(n, uintptr_t);
 
-       KASSERT(off < n->m_len);
+       KASSERT(off <= n->m_len);
 
        if (__predict_false(n->m_len < (off + len))) {
                struct mbuf *m = nbuf->nb_mbuf0;



Home | Main Index | Thread Index | Old Index