diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2007-12-08 03:14:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:56:59 -0500 |
commit | 7e5449c21562f1554d2c355db1ec9d3e4f434288 (patch) | |
tree | 96e0eede0ade3339b6d4e202f77e4eecf658da4b | |
parent | c35b7e72cd48bc7163b6900fb3689fa54b572bba (diff) |
[IPV6]: route6 remove ifdef for fib_rules
The patch defines the usual static inline functions when the code is
disabled for fib6_rules. That's allow to remove some ifdef in route.c
file and make the code a little more clear.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/ip6_fib.h | 12 | ||||
-rw-r--r-- | net/ipv6/route.c | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index eaa315868792..14830edc2ac0 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -226,8 +226,18 @@ extern void fib6_gc_cleanup(void); | |||
226 | 226 | ||
227 | extern int fib6_init(void); | 227 | extern int fib6_init(void); |
228 | 228 | ||
229 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | ||
229 | extern int fib6_rules_init(void); | 230 | extern int fib6_rules_init(void); |
230 | extern void fib6_rules_cleanup(void); | 231 | extern void fib6_rules_cleanup(void); |
231 | 232 | #else | |
233 | static inline int fib6_rules_init(void) | ||
234 | { | ||
235 | return 0; | ||
236 | } | ||
237 | static inline void fib6_rules_cleanup(void) | ||
238 | { | ||
239 | return ; | ||
240 | } | ||
241 | #endif | ||
232 | #endif | 242 | #endif |
233 | #endif | 243 | #endif |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c4e890abb2d4..11ef456d67c5 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2526,11 +2526,10 @@ int __init ip6_route_init(void) | |||
2526 | if (ret) | 2526 | if (ret) |
2527 | goto out_proc_init; | 2527 | goto out_proc_init; |
2528 | 2528 | ||
2529 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | ||
2530 | ret = fib6_rules_init(); | 2529 | ret = fib6_rules_init(); |
2531 | if (ret) | 2530 | if (ret) |
2532 | goto xfrm6_init; | 2531 | goto xfrm6_init; |
2533 | #endif | 2532 | |
2534 | ret = -ENOBUFS; | 2533 | ret = -ENOBUFS; |
2535 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) || | 2534 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) || |
2536 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) || | 2535 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) || |
@@ -2542,10 +2541,8 @@ out: | |||
2542 | return ret; | 2541 | return ret; |
2543 | 2542 | ||
2544 | fib6_rules_init: | 2543 | fib6_rules_init: |
2545 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | ||
2546 | fib6_rules_cleanup(); | 2544 | fib6_rules_cleanup(); |
2547 | xfrm6_init: | 2545 | xfrm6_init: |
2548 | #endif | ||
2549 | xfrm6_fini(); | 2546 | xfrm6_fini(); |
2550 | out_proc_init: | 2547 | out_proc_init: |
2551 | ipv6_route_proc_fini(&init_net); | 2548 | ipv6_route_proc_fini(&init_net); |
@@ -2559,9 +2556,7 @@ out_kmem_cache: | |||
2559 | 2556 | ||
2560 | void ip6_route_cleanup(void) | 2557 | void ip6_route_cleanup(void) |
2561 | { | 2558 | { |
2562 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | ||
2563 | fib6_rules_cleanup(); | 2559 | fib6_rules_cleanup(); |
2564 | #endif | ||
2565 | ipv6_route_proc_fini(&init_net); | 2560 | ipv6_route_proc_fini(&init_net); |
2566 | xfrm6_fini(); | 2561 | xfrm6_fini(); |
2567 | rt6_ifdown(NULL); | 2562 | rt6_ifdown(NULL); |