Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Oct 2003 01:27:20 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Sam Leffler <sam@errno.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: anyone believe this KASSERT? 
Message-ID:  <200310240127.aa46705@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Thu, 23 Oct 2003 14:41:36 PDT." <200310231441.36966.sam@errno.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200310231441.36966.sam@errno.com>, Sam Leffler writes:
>uipc_socket.c has a KASSERT in soreceive that I think is wrong.  It dates from
> 
>a long time ago but I can't tell exactly who created it since some 
>intermediate munging buggered the CVS logs.

It was there in revision 1.1 as:

	m = so->so_rcv.sb_mb;
	...
	if (m == 0 || (...) &&
	    m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0) {
#ifdef DIAGNOSTIC
		if (m == 0 && so->so_rcv.sb_cc)
			panic("receive 1");
#endif

Seems to be clearer there except for the lack of brackets around
the (a && b && c) - it's just saying that if sb_mb is NULL then
sb_cc should be zero. The current code appears to do the same thing,
so looks reasonable unless I'm missing something (sb_mb should be
NULL when there is no data queued shouldn't it?).

Digging back even further:

REV:7.13                uipc_socket.c       1989/04/22 12:26:53       sklower

   checkpoint for version to be handed to NIST, simple tp4 connection

...
-       if (so->so_rcv.sb_cc == 0) {
+       m = so->so_rcv.sb_mb;
+       if (m == 0) {
+               if (so->so_rcv.sb_cc)
+                       panic("receive 1");

Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310240127.aa46705>