aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_rules.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-10 06:21:49 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:01:25 -0500
commitdbb50165b512f6c9b7aae10af73ae5b6d811f4d0 (patch)
tree9ba74fb468ec461668351a64c76c5f5d469842fa /net/ipv4/fib_rules.c
parent61a0265344786a548e8a0b26cb668e78a71f9602 (diff)
[IPV4]: Check fib4_rules_init failure.
This adds error paths into both versions of fib4_rules_init (with/without CONFIG_IP_MULTIPLE_TABLES) and returns error code to the caller. Acked-by: Benjamin Thery <benjamin.thery@bull.net> Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_rules.c')
-rw-r--r--net/ipv4/fib_rules.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index afe669dd1bd5..0751734ecf41 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -311,8 +311,18 @@ static int __init fib_default_rules_init(void)
311 return 0; 311 return 0;
312} 312}
313 313
314void __init fib4_rules_init(void) 314int __init fib4_rules_init()
315{ 315{
316 BUG_ON(fib_default_rules_init()); 316 int err;
317
317 fib_rules_register(&init_net, &fib4_rules_ops); 318 fib_rules_register(&init_net, &fib4_rules_ops);
319 err = fib_default_rules_init();
320 if (err < 0)
321 goto fail;
322 return 0;
323
324fail:
325 /* also cleans all rules already added */
326 fib_rules_unregister(&init_net, &fib4_rules_ops);
327 return err;
318} 328}