From owner-freebsd-net@FreeBSD.ORG Wed Aug 22 14:25:39 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41C4516A421 for ; Wed, 22 Aug 2007 14:25:39 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id 17F3D13C45B for ; Wed, 22 Aug 2007 14:25:39 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 953412314D; Wed, 22 Aug 2007 10:25:37 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 22 Aug 2007 10:25:37 -0400 X-Sasl-enc: UzovPY+qoIYPHdFvX4gGaXs7u7zXW7QEMQWv/S2gK1hr 1187792737 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id DC4C5148D; Wed, 22 Aug 2007 10:25:36 -0400 (EDT) Message-ID: <46CC475F.8030505@FreeBSD.org> Date: Wed, 22 Aug 2007 15:25:35 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.4 (X11/20070630) MIME-Version: 1.0 To: Ivo Vachkov References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net Subject: Re: Route caching ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2007 14:25:39 -0000 Ivo Vachkov wrote: > Does FreeBSD rtalloc*() (or any other) functions implement route > caching and how ? I looked at the code but it's not exactly easiest > thing to read / understand :) Not really, at least, not in the way one would think. rtalloc() is a legacy function. ip_output() will still call rtalloc() if you pass it a filled out 'struct route', a structure which is not a route, but an internal request to look up a route. This is a wrapper for rtalloc_ign(), which in turn is a wrapper for rtalloc1(), the function which does the actual lookup. rtalloc_ign() is pretty straightforward. Note however that this approach only checks the RTF_UP flag and ifp, nothing more. This makes it suitable for implementing floating statics, but nothing more dynamic than that. regards, BMS