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 <[EMAIL PROTECTED]>
---
 include/net/ip6_fib.h |   12 +++++++++++-
 net/ipv6/route.c      |    7 +------
 2 files changed, 12 insertions(+), 7 deletions(-)

Index: net-2.6.25/include/net/ip6_fib.h
===================================================================
--- net-2.6.25.orig/include/net/ip6_fib.h
+++ net-2.6.25/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
Index: net-2.6.25/net/ipv6/route.c
===================================================================
--- net-2.6.25.orig/net/ipv6/route.c
+++ net-2.6.25/net/ipv6/route.c
@@ -2521,11 +2521,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) ||
@@ -2537,10 +2536,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);
@@ -2554,9 +2551,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);

-- 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to