From owner-freebsd-current Fri Jun 21 8:57: 5 2002 Delivered-To: freebsd-current@freebsd.org Received: from mta5.snfc21.pbi.net (mta5.snfc21.pbi.net [206.13.28.241]) by hub.freebsd.org (Postfix) with ESMTP id 641EE37B401; Fri, 21 Jun 2002 08:57:00 -0700 (PDT) Received: from FreeBSD.org ([63.193.112.125]) by mta5.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GY2005KQCAZM9@mta5.snfc21.pbi.net>; Fri, 21 Jun 2002 08:57:00 -0700 (PDT) Date: Fri, 21 Jun 2002 08:57:10 -0700 From: Jeffrey Hsu Subject: Re: fix for a bug that causes a panic in the udp_pcblist() sysctl In-reply-to: Message from Maxime Henrion "of Fri, 21 Jun 2002 06:42:39 PDT." <20020621134239.GX85244@elvis.mu.org> To: Maxime Henrion Cc: current@FreeBSD.org Message-id: <0GY2005KRCAZM9@mta5.snfc21.pbi.net> MIME-version: 1.0 X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Can you try this fix instead? It's based on a similar patch Jonathan Lemon sent to me for a similar spot in tcp_subr.c. Index: udp_usrreq.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/udp_usrreq.c,v retrieving revision 1.113 diff -u -r1.113 udp_usrreq.c --- udp_usrreq.c 14 Jun 2002 08:35:14 -0000 1.113 +++ udp_usrreq.c 21 Jun 2002 15:54:26 -0000 @@ -615,12 +615,9 @@ for (inp = LIST_FIRST(udbinfo.listhead), i = 0; inp && i < n; inp = LIST_NEXT(inp, inp_list)) { INP_LOCK(inp); - if (inp->inp_gencnt <= gencnt) { - if (cr_canseesocket(req->td->td_ucred, - inp->inp_socket)) - continue; + if (inp->inp_gencnt <= gencnt && + cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0) inp_list[i++] = inp; - } INP_UNLOCK(inp); } INP_INFO_RUNLOCK(&udbinfo); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message