Date: Tue, 3 Nov 1998 11:10:01 -0800 (PST) From: Bill Fenner <fenner@FreeBSD.ORG> To: freebsd-bugs@FreeBSD.ORG Subject: Re: misc/8494: sbcheck is broken Message-ID: <199811031910.LAA00816@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/8494; it has been noted by GNATS. From: Bill Fenner <fenner@FreeBSD.ORG> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811031910.LAA00816>