From owner-freebsd-net@FreeBSD.ORG Tue Feb 24 03:51:40 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F4DF16A4CE; Tue, 24 Feb 2004 03:51:40 -0800 (PST) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id A93D043D3F; Tue, 24 Feb 2004 03:51:39 -0800 (PST) (envelope-from glebius@cell.sick.ru) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.9/8.12.8) with ESMTP id i1OBpbQE078253 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Feb 2004 14:51:37 +0300 (MSK) (envelope-from glebius@cell.sick.ru) Received: (from glebius@localhost) by cell.sick.ru (8.12.9/8.12.6/Submit) id i1OBpauS078252; Tue, 24 Feb 2004 14:51:37 +0300 (MSK) Date: Tue, 24 Feb 2004 14:51:36 +0300 From: Gleb Smirnoff To: Andre Oppermann Message-ID: <20040224115136.GA78223@cell.sick.ru> Mail-Followup-To: Gleb Smirnoff , Andre Oppermann , freebsd-net@freebsd.org References: <20040224080353.GA76272@cell.sick.ru> <403B2423.DABF2E48@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <403B2423.DABF2E48@freebsd.org> User-Agent: Mutt/1.5.6i cc: freebsd-net@freebsd.org Subject: Re: rtalloc()/rtfree() problems on CURRENT X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2004 11:51:40 -0000 Andre, I can provide you with any additional information, since I have crashdump saved. I can dig into the problem myself if you give me some pointers where to look at. On Tue, Feb 24, 2004 at 11:14:59AM +0100, Andre Oppermann wrote: A> Gleb Smirnoff wrote: A> > A> > Dear sirs, A> > A> > please take a look at the following problem. I've been A> > successfully using the following code on STABLE and 5.1-RELEASE: A> > A> > struct route ro; A> > struct sockaddr_in *sin; A> > A> > bzero((caddr_t)&ro, sizeof(ro)); A> > sin = (struct sockaddr_in *)&ro.ro_dst; A> > sin->sin_len = sizeof(*sin); A> > sin->sin_family = AF_INET; A> > sin->sin_addr = fle->r.r_dst; A> > rtalloc(&ro); A> A> Most of the time, if you don't need a cloned route allocated, you can A> just use rtalloc_ign(&ro, RTF_CLONING) to just get a reference to the A> existing rtentry. Not allocating a new cloned route saves work and A> time for the rtalloc code. A> A> > if (ro.ro_rt != NULL) { A> > struct rtentry *rt = ro.ro_rt; A> > A> > /* here some read-only things are done with rt */ A> A> Maybe you do some nasty things to rt here? A> A> > rtfree(ro.ro_rt); A> > } A> > A> > But on CURRENT rtfree() causes panic. Here is backtrace: A> ... A> > Does this mean that something is broken in CURRENT or I am doing something wrong? A> A> rtalloc() and rtfree() are used quite often in the network code and A> otherwise work fine. The odds are high that you are doing something A> wrong. A> A> -- A> Andre -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE