summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_rmx.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-10-14 19:19:12 +0000
committersam <sam@FreeBSD.org>2003-10-14 19:19:12 +0000
commit5355d8b45455678eb500767f7087ad40bae69576 (patch)
tree1a1e112aca0afe150b960ab373b5f73234f12485 /sys/netinet/in_rmx.c
parent5daf1cdd10e30bbb9d6d0a7e713d6d6bb25e4123 (diff)
downloadFreeBSD-src-5355d8b45455678eb500767f7087ad40bae69576.zip
FreeBSD-src-5355d8b45455678eb500767f7087ad40bae69576.tar.gz
Lock ip forwarding route cache. While we're at it, remove the global
variable ipforward_rt by introducing an ip_forward_cacheinval() call to use to invalidate the cache. Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet/in_rmx.c')
-rw-r--r--sys/netinet/in_rmx.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index 5092bb9..baa8c71 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -141,13 +141,10 @@ in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
/*
* 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.
+ * flush any cached routes to avoid using a stale value.
*/
- if (ret != NULL && ipforwarding && ipforward_rt.ro_rt) {
- RTFREE(ipforward_rt.ro_rt);
- ipforward_rt.ro_rt = 0;
- }
+ if (ret != NULL && ipforwarding)
+ ip_forward_cacheinval();
return ret;
}
OpenPOWER on IntegriCloud