Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d9e6a5819230b5a5cc036f213135cb123ab1e50
Commit:     9d9e6a5819230b5a5cc036f213135cb123ab1e50
Parent:     c8822a4e00442e65d42d50db8e529d75c2025630
Author:     Thomas Graf <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 25 23:20:05 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:27:07 2007 -0700

    [NET] rules: Use rtnl registration interface
    
    Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/fib_rules.h |    6 +-----
 net/core/fib_rules.c    |    8 ++++++--
 net/core/rtnetlink.c    |    5 -----
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index d585ea9..b2b9ccd 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -5,7 +5,7 @@
 #include <linux/netdevice.h>
 #include <linux/fib_rules.h>
 #include <net/flow.h>
-#include <net/netlink.h>
+#include <net/rtnetlink.h>
 
 struct fib_rule
 {
@@ -99,10 +99,6 @@ extern int                   fib_rules_lookup(struct 
fib_rules_ops *,
                                                 struct flowi *, int flags,
                                                 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 *,
                                               struct netlink_callback *, int);
 #endif
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 7174ced..bf45f24 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -174,7 +174,7 @@ errout:
        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_rules_ops *ops = NULL;
@@ -265,7 +265,7 @@ errout:
        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_rules_ops *ops = NULL;
@@ -501,6 +501,10 @@ static struct notifier_block fib_rules_notifier = {
 
 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);
 }
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 3044702..5cc09f8 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -963,11 +963,6 @@ static struct rtnetlink_link 
link_rtnetlink_table[RTM_NR_MSGTYPES] =
 {
        [RTM_GETADDR     - 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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to