Subject: re: kern/32856: panic: uipc 3
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: matthew green <mrg@eterna.com.au>
List: netbsd-bugs
Date: 03/01/2006 01:45:02
The following reply was made to PR kern/32856; it has been noted by GNATS.

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, Christian Biere <christianbiere@gmx.de>
Subject: re: kern/32856: panic: uipc 3 
Date: Wed, 01 Mar 2006 12:40:14 +1100

     
     Index: uipc_usrreq.c
     ===================================================================
     RCS file: /cvsroot/src/sys/kern/uipc_usrreq.c,v
     retrieving revision 1.86
     diff -u -p -u -r1.86 uipc_usrreq.c
     --- uipc_usrreq.c	11 Dec 2005 12:24:30 -0000	1.86
     +++ uipc_usrreq.c	28 Feb 2006 16:51:26 -0000
     @@ -339,8 +339,10 @@ uipc_usrreq(struct socket *so, int req, 
      		case SOCK_STREAM:
      #define	rcv (&so2->so_rcv)
      #define	snd (&so->so_snd)
     -			if (unp->unp_conn == 0)
     -				panic("uipc 3");
     +			if (unp->unp_conn == 0) {
     +				error = ENOTCONN;
     +				break;
     +			}
      			so2 = unp->unp_conn->unp_socket;
      			if (unp->unp_conn->unp_flags & UNP_WANTCRED) {
      				/*
 
 
 i don't know but isn't this just going to hide a real bug?  it
 seems that the panic() is to uncover an unconsistent condition
 and we've done that, so the correct solution is to find what is
 causing that and fix it, rather than change the panic.
 
 
 (i'm not familiar with this exact code, but the above seems to
 be a fairly common case in kernel code.)