Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78358
b: refs/heads/master
c: 9eb87f3
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Lezcano authored and David S. Miller committed Jan 28, 2008
1 parent 50d444c commit 98650f1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0013cabab30ec55830ce63d34c0bdd887eb87644
refs/heads/master: 9eb87f3f7e0686a256c5bb4f886dede0171245f2
1 change: 1 addition & 0 deletions trunk/include/net/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)

extern int fib_rules_register(struct fib_rules_ops *);
extern int fib_rules_unregister(struct fib_rules_ops *);
extern void fib_rules_cleanup_ops(struct fib_rules_ops *);

extern int fib_rules_lookup(struct fib_rules_ops *,
struct flowi *, int flags,
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ extern void fib6_gc_cleanup(void);

extern int fib6_init(void);

extern void fib6_rules_init(void);
extern int fib6_rules_init(void);
extern void fib6_rules_cleanup(void);

#endif
Expand Down
5 changes: 3 additions & 2 deletions trunk/net/core/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int fib_rules_register(struct fib_rules_ops *ops)

EXPORT_SYMBOL_GPL(fib_rules_register);

static void cleanup_ops(struct fib_rules_ops *ops)
void fib_rules_cleanup_ops(struct fib_rules_ops *ops)
{
struct fib_rule *rule, *tmp;

Expand All @@ -111,6 +111,7 @@ static void cleanup_ops(struct fib_rules_ops *ops)
fib_rule_put(rule);
}
}
EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops);

int fib_rules_unregister(struct fib_rules_ops *ops)
{
Expand All @@ -121,7 +122,7 @@ int fib_rules_unregister(struct fib_rules_ops *ops)
list_for_each_entry(o, &rules_ops, list) {
if (o == ops) {
list_del_rcu(&o->list);
cleanup_ops(ops);
fib_rules_cleanup_ops(ops);
goto out;
}
}
Expand Down
19 changes: 16 additions & 3 deletions trunk/net/ipv6/fib6_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,23 @@ static int __init fib6_default_rules_init(void)
return 0;
}

void __init fib6_rules_init(void)
int __init fib6_rules_init(void)
{
BUG_ON(fib6_default_rules_init());
fib_rules_register(&fib6_rules_ops);
int ret;

ret = fib6_default_rules_init();
if (ret)
goto out;

ret = fib_rules_register(&fib6_rules_ops);
if (ret)
goto out_default_rules_init;
out:
return ret;

out_default_rules_init:
fib_rules_cleanup_ops(&fib6_rules_ops);
goto out;
}

void fib6_rules_cleanup(void)
Expand Down

0 comments on commit 98650f1

Please sign in to comment.