diff options
author | sam <sam@FreeBSD.org> | 2003-10-14 19:19:12 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-10-14 19:19:12 +0000 |
commit | 5355d8b45455678eb500767f7087ad40bae69576 (patch) | |
tree | 1a1e112aca0afe150b960ab373b5f73234f12485 /sys/netinet/in_rmx.c | |
parent | 5daf1cdd10e30bbb9d6d0a7e713d6d6bb25e4123 (diff) | |
download | FreeBSD-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.c | 9 |
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; } |