summaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_rules.c
diff options
context:
space:
mode:
authorThomas Graf2007-03-27 22:56:52 +0200
committerDavid S. Miller2007-04-26 07:28:18 +0200
commit73417f617a93cf30342c3ea41abc38927bd467aa (patch)
tree6093005afdca1825197758d851ca5f275d62356f /net/decnet/dn_rules.c
parent[NET]: inet_ehash_secret should be __read_mostly and set only once (diff)
downloadkernel-qcow2-linux-73417f617a93cf30342c3ea41abc38927bd467aa.tar.gz
kernel-qcow2-linux-73417f617a93cf30342c3ea41abc38927bd467aa.tar.xz
kernel-qcow2-linux-73417f617a93cf30342c3ea41abc38927bd467aa.zip
[NET] fib_rules: Flush route cache after rule modifications
The results of FIB rules lookups are cached in the routing cache except for IPv6 as no such cache exists. So far, it was the responsibility of the user to flush the cache after modifying any rules. This lead to many false bug reports due to misunderstanding of this concept. This patch automatically flushes the route cache after inserting or deleting a rule. Thanks to Muli Ben-Yehuda <muli@il.ibm.com> for catching a bug in the previous patch. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_rules.c')
-rw-r--r--net/decnet/dn_rules.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index fd0cc2aa316c..7f58b95b27d1 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -31,6 +31,7 @@
#include <net/dn_fib.h>
#include <net/dn_neigh.h>
#include <net/dn_dev.h>
+#include <net/dn_route.h>
static struct fib_rules_ops dn_fib_rules_ops;
@@ -239,6 +240,11 @@ static u32 dn_fib_rule_default_pref(void)
return 0;
}
+static void dn_fib_rule_flush_cache(void)
+{
+ dn_rt_cache_flush(0);
+}
+
static struct fib_rules_ops dn_fib_rules_ops = {
.family = AF_DECnet,
.rule_size = sizeof(struct dn_fib_rule),
@@ -249,6 +255,7 @@ static struct fib_rules_ops dn_fib_rules_ops = {
.compare = dn_fib_rule_compare,
.fill = dn_fib_rule_fill,
.default_pref = dn_fib_rule_default_pref,
+ .flush_cache = dn_fib_rule_flush_cache,
.nlgroup = RTNLGRP_DECnet_RULE,
.policy = dn_fib_rule_policy,
.rules_list = &dn_fib_rules,