]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[IPV6]: route6 remove ifdef for fib_rules
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Sat, 8 Dec 2007 08:14:54 +0000 (00:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:56:59 +0000 (14:56 -0800)
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>
include/net/ip6_fib.h
net/ipv6/route.c

index eaa315868792681eed7a99c94fa92e599c92b957..14830edc2ac0d8213888abf488753452571d379e 100644 (file)
@@ -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 c4e890abb2d4d983b027dd64d5d5d170c8a5a098..11ef456d67c548197219d9c1befa8d5db91565be 100644 (file)
@@ -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);