Commit 9d9e6a58 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[NET] rules: Use rtnl registration interface

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c8822a4e
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/fib_rules.h> #include <linux/fib_rules.h>
#include <net/flow.h> #include <net/flow.h>
#include <net/netlink.h> #include <net/rtnetlink.h>
struct fib_rule struct fib_rule
{ {
...@@ -99,10 +99,6 @@ extern int fib_rules_lookup(struct fib_rules_ops *, ...@@ -99,10 +99,6 @@ extern int fib_rules_lookup(struct fib_rules_ops *,
struct flowi *, int flags, struct flowi *, int flags,
struct fib_lookup_arg *); struct fib_lookup_arg *);
extern int fib_nl_newrule(struct sk_buff *,
struct nlmsghdr *, void *);
extern int fib_nl_delrule(struct sk_buff *,
struct nlmsghdr *, void *);
extern int fib_rules_dump(struct sk_buff *, extern int fib_rules_dump(struct sk_buff *,
struct netlink_callback *, int); struct netlink_callback *, int);
#endif #endif
...@@ -174,7 +174,7 @@ errout: ...@@ -174,7 +174,7 @@ errout:
return err; return err;
} }
int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
{ {
struct fib_rule_hdr *frh = nlmsg_data(nlh); struct fib_rule_hdr *frh = nlmsg_data(nlh);
struct fib_rules_ops *ops = NULL; struct fib_rules_ops *ops = NULL;
...@@ -265,7 +265,7 @@ errout: ...@@ -265,7 +265,7 @@ errout:
return err; return err;
} }
int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
{ {
struct fib_rule_hdr *frh = nlmsg_data(nlh); struct fib_rule_hdr *frh = nlmsg_data(nlh);
struct fib_rules_ops *ops = NULL; struct fib_rules_ops *ops = NULL;
...@@ -501,6 +501,10 @@ static struct notifier_block fib_rules_notifier = { ...@@ -501,6 +501,10 @@ static struct notifier_block fib_rules_notifier = {
static int __init fib_rules_init(void) static int __init fib_rules_init(void)
{ {
rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL);
rtnl_register(PF_UNSPEC, RTM_DELRULE, fib_nl_delrule, NULL);
rtnl_register(PF_UNSPEC, RTM_GETRULE, NULL, rtnl_dump_all);
return register_netdevice_notifier(&fib_rules_notifier); return register_netdevice_notifier(&fib_rules_notifier);
} }
......
...@@ -963,11 +963,6 @@ static struct rtnetlink_link link_rtnetlink_table[RTM_NR_MSGTYPES] = ...@@ -963,11 +963,6 @@ static struct rtnetlink_link link_rtnetlink_table[RTM_NR_MSGTYPES] =
{ {
[RTM_GETADDR - RTM_BASE] = { .dumpit = rtnl_dump_all }, [RTM_GETADDR - RTM_BASE] = { .dumpit = rtnl_dump_all },
[RTM_GETROUTE - RTM_BASE] = { .dumpit = rtnl_dump_all }, [RTM_GETROUTE - RTM_BASE] = { .dumpit = rtnl_dump_all },
#ifdef CONFIG_FIB_RULES
[RTM_NEWRULE - RTM_BASE] = { .doit = fib_nl_newrule },
[RTM_DELRULE - RTM_BASE] = { .doit = fib_nl_delrule },
#endif
[RTM_GETRULE - RTM_BASE] = { .dumpit = rtnl_dump_all },
}; };
static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr) static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment