[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>
This commit is contained in:
Thomas Graf
2007-03-27 13:56:52 -07:00
committed by David S. Miller
parent be776281ae
commit 73417f617a
4 changed files with 25 additions and 0 deletions

View File

@@ -59,6 +59,10 @@ struct fib_rules_ops
u32 (*default_pref)(void);
size_t (*nlmsg_payload)(struct fib_rule *);
/* Called after modifications to the rules set, must flush
* the route cache if one exists. */
void (*flush_cache)(void);
int nlgroup;
struct nla_policy *policy;
struct list_head *rules_list;