From owner-freebsd-net@FreeBSD.ORG Thu Mar 12 00:16:53 2015 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 704ACBBA; Thu, 12 Mar 2015 00:16:53 +0000 (UTC) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EEDB395; Thu, 12 Mar 2015 00:16:51 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id D781D12D2E; Thu, 12 Mar 2015 01:16:47 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id 8ECCD2E3EF; Thu, 12 Mar 2015 01:16:47 +0100 (CET) Date: Thu, 12 Mar 2015 01:16:47 +0100 From: Kristof Provost To: "Andrey V. Elsukov" Subject: Re: [PATCH] Fix panic with pf fastroute Message-ID: <20150312001647.GS1975@vega.codepro.be> References: <1426064691-1238-1-git-send-email-kristof@sigsegv.be> <20150311083916.GQ1975@vega.codepro.be> <55000FDF.10007@yandex.ru> <20150311125050.GR1975@vega.codepro.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150311125050.GR1975@vega.codepro.be> X-PGP-Fingerprint: E114 D9EA 909E D469 8F57 17A5 7D15 91C6 9EFA F286 X-Checked-By-NSA: Probably User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-net@FreeBSD.org, freebsd-pf@FreeBSD.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-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: Thu, 12 Mar 2015 00:16:53 -0000 On 2015-03-11 13:50:50 (+0100), Kristof Provost wrote: > On 2015-03-11 12:50:23 (+0300), Andrey V. Elsukov wrote: > > It looks like there are some code paths that do a copy of original mbuf. > > Are you sure this doesn't introduce mbuf leak? > > > I'll check again in the morning when I'm less drunk and jet lagged, but > I'm pretty confident this is correct. > There are only two exit points from pf_route6(), this one only happens > in case of FASTROUTE, not DUPTO (which is the one that duplicates). > So, yes, the duplication is only done if r->rt == PF_DUPTO and the case I fixed is r->rt == PF_FASTROUTE. Regards, Kristof