From owner-freebsd-net Sat Oct 5 10:26:36 2002 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 37E7F37B401; Sat, 5 Oct 2002 10:26:35 -0700 (PDT) Received: from rodney.cnchost.com (rodney.concentric.net [207.155.252.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC25243E75; Sat, 5 Oct 2002 10:26:34 -0700 (PDT) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by rodney.cnchost.com id NAA27565; Sat, 5 Oct 2002 13:26:32 -0400 (EDT) [ConcentricHost SMTP Relay 1.14] Message-ID: <200210051726.NAA27565@rodney.cnchost.com> To: Koroush Saraf Cc: rizzo@icir.org, ru@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: Consistency of cached routes In-reply-to: Your message of "Fri, 04 Oct 2002 20:56:46 PDT." Date: Sat, 05 Oct 2002 10:26:32 -0700 From: Bakul Shah Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I said: > If your problem is a cached route used for forwarding, you > ought to run something more recent than 19-Mar-2002 (which is > when Ruslan put in the fix in sys/netinet/in_rmx.c). I didn't look carefully enough. This bug fix was put in in_rmx.c rev 1.39. It didn't get merged back to -stable until 9-Aug (in_rmx.c rev 1.37.2.3), which is unfortunately *after* the last release. If you're running a released version of FreeBSD, your choices are: a. Wait for the next release b. Uprgade to -stable c. Apply the below patch to /sys/netinet/in_rmx.c and recompile. @@ -54,6 +54,7 @@ #include #include #include +extern struct route ipforward_rt; /* ip forwarding cached route */ extern int in_inithead __P((void **head, int off)); @@ -135,6 +136,17 @@ RTFREE(rt2); } } + + /* + * If the new route created successfully, and we are forwarding, + * and there is a cached route, free it. Otherwise, we may end + * up using the wrong route. + */ + if (ret != NULL && ipforwarding && ipforward_rt.ro_rt) { + RTFREE(ipforward_rt.ro_rt); + ipforward_rt.ro_rt = 0; + } + return ret; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message