Date: Sat, 05 Oct 2002 10:26:32 -0700 From: Bakul Shah <bakul@bitblocks.com> To: Koroush Saraf <koroush.saraf@lmco.com> Cc: rizzo@icir.org, ru@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: Consistency of cached routes Message-ID: <200210051726.NAA27565@rodney.cnchost.com> In-Reply-To: Your message of "Fri, 04 Oct 2002 20:56:46 PDT."
next in thread | raw e-mail | index | archive | help
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 <net/route.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
+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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210051726.NAA27565>
