From owner-freebsd-bugs Tue Nov 3 11:10:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA22899 for freebsd-bugs-outgoing; Tue, 3 Nov 1998 11:10:01 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA22850 for ; Tue, 3 Nov 1998 11:09:59 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id LAA00816; Tue, 3 Nov 1998 11:10:01 -0800 (PST) Date: Tue, 3 Nov 1998 11:10:01 -0800 (PST) Message-Id: <199811031910.LAA00816@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Bill Fenner Subject: Re: misc/8494: sbcheck is broken Reply-To: Bill Fenner Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR misc/8494; it has been noted by GNATS. From: Bill Fenner To: freebsd-gnats-submit@FreeBSD.org, avr@juniper.net Cc: Subject: Re: misc/8494: sbcheck is broken Date: Tue, 3 Nov 1998 11:00:04 -0800 (PST) I wrote this code when trying to use sbcheck() myself a while ago. Does this do what you want? Bill cvs diff: Diffing . Index: uipc_socket2.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_socket2.c,v retrieving revision 1.39 diff -u -r1.39 uipc_socket2.c --- uipc_socket2.c 1998/09/05 13:24:39 1.39 +++ uipc_socket2.c 1998/11/03 18:58:16 @@ -477,15 +477,17 @@ register struct sockbuf *sb; { register struct mbuf *m; + register struct mbuf *n = 0; register int len = 0, mbcnt = 0; - for (m = sb->sb_mb; m; m = m->m_next) { + for (m = sb->sb_mb; m; m = n) { + n = m->m_nextpkt; + for (; m; m = m->m_next) { len += m->m_len; mbcnt += MSIZE; if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */ mbcnt += m->m_ext.ext_size; - if (m->m_nextpkt) - panic("sbcheck nextpkt"); + } } if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) { printf("cc %d != %d || mbcnt %d != %d\n", len, sb->sb_cc, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message