aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_rules.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2007-03-27 16:56:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:18 -0400
commit73417f617a93cf30342c3ea41abc38927bd467aa (patch)
tree6093005afdca1825197758d851ca5f275d62356f /net/decnet/dn_rules.c
parentbe776281aee54626a474ba06f91926b98bdd180d (diff)
[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 @@
31#include <net/dn_fib.h> 31#include <net/dn_fib.h>
32#include <net/dn_neigh.h> 32#include <net/dn_neigh.h>
33#include <net/dn_dev.h> 33#include <net/dn_dev.h>
34#include <net/dn_route.h>
34 35
35static struct fib_rules_ops dn_fib_rules_ops; 36static struct fib_rules_ops dn_fib_rules_ops;
36 37
@@ -239,6 +240,11 @@ static u32 dn_fib_rule_default_pref(void)
239 return 0; 240 return 0;
240} 241}
241 242
243static void dn_fib_rule_flush_cache(void)
244{
245 dn_rt_cache_flush(0);
246}
247
242static struct fib_rules_ops dn_fib_rules_ops = { 248static struct fib_rules_ops dn_fib_rules_ops = {
243 .family = AF_DECnet, 249 .family = AF_DECnet,
244 .rule_size = sizeof(struct dn_fib_rule), 250 .rule_size = sizeof(struct dn_fib_rule),
@@ -249,6 +255,7 @@ static struct fib_rules_ops dn_fib_rules_ops = {
249 .compare = dn_fib_rule_compare, 255 .compare = dn_fib_rule_compare,
250 .fill = dn_fib_rule_fill, 256 .fill = dn_fib_rule_fill,
251 .default_pref = dn_fib_rule_default_pref, 257 .default_pref = dn_fib_rule_default_pref,
258 .flush_cache = dn_fib_rule_flush_cache,
252 .nlgroup = RTNLGRP_DECnet_RULE, 259 .nlgroup = RTNLGRP_DECnet_RULE,
253 .policy = dn_fib_rule_policy, 260 .policy = dn_fib_rule_policy,
254 .rules_list = &dn_fib_rules, 261 .rules_list = &dn_fib_rules,