diff options
Diffstat (limited to 'net/ipv4/fib_hash.c')
-rw-r--r-- | net/ipv4/fib_hash.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index ecd39454235c..4ed7e0dea1bc 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/skbuff.h> | 32 | #include <linux/skbuff.h> |
33 | #include <linux/netlink.h> | 33 | #include <linux/netlink.h> |
34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
35 | #include <linux/slab.h> | ||
35 | 36 | ||
36 | #include <net/net_namespace.h> | 37 | #include <net/net_namespace.h> |
37 | #include <net/ip.h> | 38 | #include <net/ip.h> |
@@ -242,8 +243,8 @@ fn_new_zone(struct fn_hash *table, int z) | |||
242 | return fz; | 243 | return fz; |
243 | } | 244 | } |
244 | 245 | ||
245 | static int | 246 | int fib_table_lookup(struct fib_table *tb, |
246 | fn_hash_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result *res) | 247 | const struct flowi *flp, struct fib_result *res) |
247 | { | 248 | { |
248 | int err; | 249 | int err; |
249 | struct fn_zone *fz; | 250 | struct fn_zone *fz; |
@@ -274,8 +275,8 @@ out: | |||
274 | return err; | 275 | return err; |
275 | } | 276 | } |
276 | 277 | ||
277 | static void | 278 | void fib_table_select_default(struct fib_table *tb, |
278 | fn_hash_select_default(struct fib_table *tb, const struct flowi *flp, struct fib_result *res) | 279 | const struct flowi *flp, struct fib_result *res) |
279 | { | 280 | { |
280 | int order, last_idx; | 281 | int order, last_idx; |
281 | struct hlist_node *node; | 282 | struct hlist_node *node; |
@@ -366,7 +367,7 @@ static struct fib_node *fib_find_node(struct fn_zone *fz, __be32 key) | |||
366 | return NULL; | 367 | return NULL; |
367 | } | 368 | } |
368 | 369 | ||
369 | static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | 370 | int fib_table_insert(struct fib_table *tb, struct fib_config *cfg) |
370 | { | 371 | { |
371 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; | 372 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; |
372 | struct fib_node *new_f = NULL; | 373 | struct fib_node *new_f = NULL; |
@@ -544,8 +545,7 @@ out: | |||
544 | return err; | 545 | return err; |
545 | } | 546 | } |
546 | 547 | ||
547 | 548 | int fib_table_delete(struct fib_table *tb, struct fib_config *cfg) | |
548 | static int fn_hash_delete(struct fib_table *tb, struct fib_config *cfg) | ||
549 | { | 549 | { |
550 | struct fn_hash *table = (struct fn_hash *)tb->tb_data; | 550 | struct fn_hash *table = (struct fn_hash *)tb->tb_data; |
551 | struct fib_node *f; | 551 | struct fib_node *f; |
@@ -662,7 +662,7 @@ static int fn_flush_list(struct fn_zone *fz, int idx) | |||
662 | return found; | 662 | return found; |
663 | } | 663 | } |
664 | 664 | ||
665 | static int fn_hash_flush(struct fib_table *tb) | 665 | int fib_table_flush(struct fib_table *tb) |
666 | { | 666 | { |
667 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; | 667 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; |
668 | struct fn_zone *fz; | 668 | struct fn_zone *fz; |
@@ -743,7 +743,8 @@ fn_hash_dump_zone(struct sk_buff *skb, struct netlink_callback *cb, | |||
743 | return skb->len; | 743 | return skb->len; |
744 | } | 744 | } |
745 | 745 | ||
746 | static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlink_callback *cb) | 746 | int fib_table_dump(struct fib_table *tb, struct sk_buff *skb, |
747 | struct netlink_callback *cb) | ||
747 | { | 748 | { |
748 | int m, s_m; | 749 | int m, s_m; |
749 | struct fn_zone *fz; | 750 | struct fn_zone *fz; |
@@ -787,12 +788,7 @@ struct fib_table *fib_hash_table(u32 id) | |||
787 | 788 | ||
788 | tb->tb_id = id; | 789 | tb->tb_id = id; |
789 | tb->tb_default = -1; | 790 | tb->tb_default = -1; |
790 | tb->tb_lookup = fn_hash_lookup; | 791 | |
791 | tb->tb_insert = fn_hash_insert; | ||
792 | tb->tb_delete = fn_hash_delete; | ||
793 | tb->tb_flush = fn_hash_flush; | ||
794 | tb->tb_select_default = fn_hash_select_default; | ||
795 | tb->tb_dump = fn_hash_dump; | ||
796 | memset(tb->tb_data, 0, sizeof(struct fn_hash)); | 792 | memset(tb->tb_data, 0, sizeof(struct fn_hash)); |
797 | return tb; | 793 | return tb; |
798 | } | 794 | } |