From owner-cvs-src@FreeBSD.ORG Sun Apr 9 08:46:16 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8FB816A400; Sun, 9 Apr 2006 08:46:16 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 821DA43D60; Sun, 9 Apr 2006 08:46:05 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C3FA652126; Sun, 9 Apr 2006 10:46:03 +0200 (CEST) Received: from localhost (djw154.neoplus.adsl.tpnet.pl [83.24.0.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id CB62750F93; Sun, 9 Apr 2006 10:45:57 +0200 (CEST) Date: Sun, 9 Apr 2006 10:44:42 +0200 From: Pawel Jakub Dawidek To: Robert Watson Message-ID: <20060409084442.GE2135@garage.freebsd.pl> References: <200604011555.k31FtiYU025077@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7CZp05NP8/gJM8Cl" Content-Disposition: inline In-Reply-To: <200604011555.k31FtiYU025077@repoman.freebsd.org> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r535 (FreeBSD) X-Spam-Flag: YES X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: *** X-Spam-Status: Yes, score=3.3 required=3.0 tests=BAYES_00,RCVD_IN_DSBL, RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 X-Spam-Report: =?ISO-8859-1?Q? * -2.6 BAYES_00 BODY: Bayesowskie prawdopodobie=f1stwo spamu wynosi 0 do 1% * [score: 0.0000] * 2.0 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address * [83.24.0.154 listed in dnsbl.sorbs.net] * 3.8 RCVD_IN_DSBL RBL: Otrzymano przez relay listowany w list.dsbl.org * [] * 0.1 RCVD_IN_NJABL_DUL RBL: NJABL: nadawca dial-up u=bfywa nie lokalnego SMTP * [83.24.0.154 listed in combined.njabl.org]?= Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net raw_usrreq.c src/sys/netkey keysock.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2006 08:46:17 -0000 --7CZp05NP8/gJM8Cl Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 01, 2006 at 03:55:44PM +0000, Robert Watson wrote: +> rwatson 2006-04-01 15:55:44 UTC +>=20 +> FreeBSD src repository +>=20 +> Modified files: +> sys/net raw_usrreq.c=20 +> sys/netkey keysock.c=20 +> Log: +> In raw and raw-derived socket types, maintain and enforce invariant th= at +> the so_pcb pointer on the socket is always non-NULL. This eliminates +> countless unnecessary error checks, replacing them with assertions. [...] +> static int +> raw_uattach(struct socket *so, int proto, struct thread *td) +> { +> - struct rawcb *rp =3D sotorawcb(so); +> int error; +> =20 +> - if (rp =3D=3D 0) +> - return EINVAL; +> + KASSERT(sotorawcb(so) =3D=3D NULL, ("raw_uattach: rp !=3D NULL")); +> if (td && (error =3D suser(td)) !=3D 0) +> return error; +> return raw_attach(so, proto); My system panics on this KASSERT(9) when I setup IPsec. When you look closer, EINVAL was returned when sotorawcb(so) was equal to NULL and you change it to panic when it is not NULL. So what you really wanted here, IMHO was: KASSERT(sotorawcb(so) !=3D NULL, ("raw_uattach: rp =3D=3D NULL")); With this KASSERT(9) it works for me. BTW. There is no more 'rp' variable in the function. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --7CZp05NP8/gJM8Cl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFEOMl6ForvXbEpPzQRAg0NAJ4mpeNR6uld7rSvag75jXufq4i21QCePWuL XnbdIId4c8AFoc1o0eagn6w= =IH2F -----END PGP SIGNATURE----- --7CZp05NP8/gJM8Cl--