From owner-freebsd-net@FreeBSD.ORG Mon Mar 8 13:26:41 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 8442816A4CE; Mon, 8 Mar 2004 13:26:41 -0800 (PST) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1CCA43D31; Mon, 8 Mar 2004 13:26:39 -0800 (PST) (envelope-from ru@ip.net.ua) Received: from heffalump.office.ipnet (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.10/8.12.9) with ESMTP id i28LU31t035736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Mar 2004 23:30:04 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.office.ipnet (8.12.11/8.12.11) id i28LQYLw030427; Mon, 8 Mar 2004 23:26:34 +0200 (EET) (envelope-from ru) Date: Mon, 8 Mar 2004 23:26:34 +0200 From: Ruslan Ermilov To: Andre Oppermann Message-ID: <20040308212634.GA30394@ip.net.ua> References: <20040308102038.GA28502@ip.net.ua> <404C5F65.446E20A8@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <404C5F65.446E20A8@freebsd.org> User-Agent: Mutt/1.5.6i X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: net@freebsd.org Subject: Re: Cached IP routes 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: Mon, 08 Mar 2004 21:26:41 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 08, 2004 at 12:56:21PM +0100, Andre Oppermann wrote: [...] > > We still have a similar problem in in_gif_output(), and I wonder what > > would be a correct fix, given the above? >=20 > in_gif_output() is not the same as the route cache of ip_forward. It > just caches the route to the tunnel destination which normally stays > the same over long periods of time. The only problem you might run > into are route changes. At one point in time your best path is the > default route so a pointer to it is being cached in sc->gif_ro. Later > you have a better via some other gateway. This won't be picked up by > the gif route cache. In 5.2 and -CURRENT you can scrap the route > cache and just give a NULL to ip_output instead of a route. This way > you will always use the best path to destination. >=20 Yes, that's exactly the situation I'm faced with (yes, I know how the routing code works). For others. Initially, the route to the gif(4) tunnel's destination is through the default route. I then add an explicit host route to the tunnel destination, and "route change default" to point to the tunnel (gif0). The result is that in_gif_output() caches the default route as the route to "tunnel destination", and doesn't pick up the "best match" host route. Of course, I'm working around this by deleting and re-adding the default route, but I wonder what in your opinion would be the correct fix. As you properly mentioned, in_gif_output() is significantly different from ip_forward() because the rt_dst is always the same. Cheers, --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFATOUKUkv4P6juNwoRAjKpAJ9gZm8l/aJi24oAKbM4fp5/9t0YzQCdHbYx 2U4h1bKjXP/azNW2UNG/zuk= =xGAN -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s--