From: Daniel Lezcano Date: Sat, 8 Dec 2007 08:14:54 +0000 (-0800) Subject: [IPV6]: route6 remove ifdef for fib_rules X-Git-Tag: v2.6.25-rc1~1162^2~1172 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e5449c21562f1554d2c355db1ec9d3e4f434288;p=linux-2.6 [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 Acked-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index eaa3158687..14830edc2a 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -226,8 +226,18 @@ extern void fib6_gc_cleanup(void); extern int fib6_init(void); +#ifdef CONFIG_IPV6_MULTIPLE_TABLES extern int fib6_rules_init(void); extern void fib6_rules_cleanup(void); - +#else +static inline int fib6_rules_init(void) +{ + return 0; +} +static inline void fib6_rules_cleanup(void) +{ + return ; +} +#endif #endif #endif diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c4e890abb2..11ef456d67 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2526,11 +2526,10 @@ int __init ip6_route_init(void) if (ret) goto out_proc_init; -#ifdef CONFIG_IPV6_MULTIPLE_TABLES ret = fib6_rules_init(); if (ret) goto xfrm6_init; -#endif + ret = -ENOBUFS; if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) || __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) || @@ -2542,10 +2541,8 @@ out: return ret; fib6_rules_init: -#ifdef CONFIG_IPV6_MULTIPLE_TABLES fib6_rules_cleanup(); xfrm6_init: -#endif xfrm6_fini(); out_proc_init: ipv6_route_proc_fini(&init_net); @@ -2559,9 +2556,7 @@ out_kmem_cache: void ip6_route_cleanup(void) { -#ifdef CONFIG_IPV6_MULTIPLE_TABLES fib6_rules_cleanup(); -#endif ipv6_route_proc_fini(&init_net); xfrm6_fini(); rt6_ifdown(NULL);