mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[NET] rules: Unified rules dumping
Implements a unified, protocol independant rules dumping function which is capable of both, dumping a specific protocol family or all of them. This speeds up dumping as less lookups are required. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
687ad8cc64
commit
c454673da7
6 changed files with 45 additions and 34 deletions
|
@ -239,11 +239,6 @@ static u32 dn_fib_rule_default_pref(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
{
|
||||
return fib_rules_dump(skb, cb, AF_DECnet);
|
||||
}
|
||||
|
||||
static struct fib_rules_ops dn_fib_rules_ops = {
|
||||
.family = AF_DECnet,
|
||||
.rule_size = sizeof(struct dn_fib_rule),
|
||||
|
@ -264,12 +259,10 @@ void __init dn_fib_rules_init(void)
|
|||
{
|
||||
list_add_tail(&default_rule.common.list, &dn_fib_rules);
|
||||
fib_rules_register(&dn_fib_rules_ops);
|
||||
rtnl_register(PF_DECnet, RTM_GETRULE, NULL, dn_fib_dump_rules);
|
||||
}
|
||||
|
||||
void __exit dn_fib_rules_cleanup(void)
|
||||
{
|
||||
rtnl_unregister(PF_DECnet, RTM_GETRULE);
|
||||
fib_rules_unregister(&dn_fib_rules_ops);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue